On Mar 15, 5:42 am, MarkB <[email protected]> wrote: > My first attempt at working with a new has_many relationship is > throwing an error in the view when I try to create a new 'rcost' > instance linked to a 'resource' (each resource can have multiple > costs): > > "undefined method `rcosts_path' for #<ActionView::Base:0x715bc60>" > > Here is the view (new.html.erb) code that appears to be causing the > error (I do not reference rcosts_path anywhere in the view): > > <% form_for(@rcost) do |f| %> >
rcosts_path is being invoked by form_for, when it computes where the form should be posting too. Since you've got a nested resource you've got to tell form_for which Resource this @rcost belongs to. Fred -- 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.

