Rails 3.1.3

I'm trying to pass a value to 'save.js.erb' .

in the view,  I have put

  <%= hidden_field_tag "video-id", @video.id, { :id => "video-id" } %>

then, I can retrieve it by

        var idval = $('#video-id').val();

It certainly gets the value.

The problem is then I need to pass it to the following.
I tried,

$('#listtrans').html('<%= escape_javascript(render :partial =>
"videos/script_list", :locals => { :scripts =>
Script.find_all_by_video_id( idval ) } ) %>');   //<= idval

this does not work.

$('#listtrans').html('<%= escape_javascript(render :partial =>
"videos/script_list", :locals => { :scripts =>
Script.find_all_by_video_id(' + idval + ') } ) %>');

does not work either because of escape_javascript.

This seems simple, but I can't figure it out.

Could anyone help me out?

soichi

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to