Re: [Rails] Re: Passing instance variable to js.erb
On 16 February 2012 06:55, Soichi Ishida <lists@ruby-forum.com> wrote:
> Thanks for your answer but it give the error
Did you read the error? Google it?
> ActionView::Template::Error (Called id for nil, which would mistakenly
> be 4 -- if you really wanted the id of nil, use object_id):
>
> 3: $('#listtrans').html('<%= escape_javascript(render :partial =>
> "videos/script_list", :locals => { :scripts =>
> Script.find_all_by_video_id(@video.id) } ) %>');
>
> app/views/videos/save.js.erb:3:in
>
> Does anyone know why?
It's most likely that @video (the instance variable you want the id
of) is nil. Use debugging techniques to break into the code where it's
being set and being used to inspect it.
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home