Re: [Rails] Passing instance variable to js.erb

2013-09-17 Thread Tamara Temple
Not as old a message as I've responded to, but this one was from February of 2012… On Sep 16, 2013, at 9:26 AM, Minh Quy sugiacu...@gmail.com wrote: you should not use js with erb, it meet serious problem when you change variable rails without change js. You can use client variable gem,

[Rails] Passing instance variable to js.erb

2012-02-15 Thread Soichi Ishida
Rails 3.1.3 Hi again. I would like to pass an instance variable to HERE!!! in 'save.js.erb' $('#listtrans').html( '%= escape_javascript(render :partial = videos/script_list, :locals = { :scripts = Script.find_all_by_video_id(HERE!!!) } ) % '); If I put a specific value, video_id, (18 in

Re: [Rails] Passing instance variable to js.erb

2012-02-15 Thread Michael Pavling
On 16 February 2012 05:09, Soichi Ishida li...@ruby-forum.com wrote: I would like to pass an instance variable to HERE!!! in  'save.js.erb' $('#listtrans').html('%= escape_javascript(render :partial = videos/script_list, :locals = { :scripts = Script.find_all_by_video_id(@video.id) } ) %') --