Sunday, February 19, 2012

[Rails] Re: Ajax Update: error: undefined method `model_name'

>
> <%= form_for script, :remote => true do |f| %>

Is 'script' in form_for above a local variable or a class? form_for
normally posts or puts to a class. It doesn't look right to me.

<%= form_for @script, :remote => true do |f| %>
or
<%= form_for :script, url: edit_script_path(), remote: true do |f| %>


hope it helps

--
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 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


Real Estate