Displaying 1 result from an estimated 1 matches for "new_script".
Did you mean:
get_script
2012 Feb 22
3
Parent id for find_or_create method
Rails 3.1.3
I have tables, Video and Script having association,
Video 1 --- n Script
So, every Script needs the parent id, in this case, video_id.
If I simply create a new Script instance, the view renders as follows.
<%= render :partial => "new_script", :locals => { :script =>
Script.new(:video_id => @video.id)} %>
which works fine. Now I would like to develop further. The Script
objects may have already existed and if so, I want to update after
editing them.
So I tried,
<%= render :partial => "create_or_update...