Ruby on Rails Thursday, May 29, 2014

gon is great, and easy to use.

On Friday, May 30, 2014, Dave Sims <davsims@gmail.com> wrote:

I've used the gon gem for this and liked it quite a bit.

https://github.com/gazay/gon

Pierre-Andre M. wrote:

I have a variable created by some ruby in my controller that looks like
this:

@begpoint = row["begpoint"]


and I want to pass it into some js that is referenced from within my
view:

view:

   <% javascript_include_tag "play_time" %>



js (play_time):

I am trying to pass "<beg-point>  into the js [obviously that<>  is not
the right syntax just trying to denote where'd id like the variable to
end up]


var endtime =<beg-point>+10;
myPlayer= document.getElementById('example_video_1');
myPlayer.addEventListener('loadeddata', function(){
     myPlayer.currentTime = 10505.89;
     myPlayer.play();
     myPlayer.addEventListener('timeupdate', function(){
     if (myPlayer.currentTime>= endtime) {
         myPlayer.pause();
     }


Can anyone help?  Thanks

     }, false);

}, false);

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5387C680.30601%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
 greatghoul - Ask and Learn!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAFoKNZMGPr%2Bmsf%3DsuutRaH2S9Qphc-uVUNpb_NZkzYVSHkuPmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment