On 21 July 2011 09:29, Jen <jen.bot...@gmail.com> wrote: > Hi Paul, > Thanks for the reply! > > Am I correct in thinking that for the data my user enters in the fields > relating to resources to be inserted in to the resources table I need to > render a complete form, not just a list of fields? > > I have tried this approach and am receiving the following error: > > NoMethodError in Universities#new > > Showing /home/resource_portal/website/app/views/resources/_form.html.erb > where line #1 raised: > > undefined method `model_name' for NilClass:Class > > Extracted source (around line #1): > > 1: <%= form_for(@resource) do |f| %>
The error simply means that @resource is nil. If you set this in the controller using find then maybe the find did not find a matching record. Colin -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.