Frederick Cheung wrote in post #1035546: > On Dec 7, 11:10am, Mathew Birch <[email protected]> wrote: >> Now my problem is that when I now click the edit button it comes up with >> an error: >> >> TypeError in Sub_categories#edit >> Showing ItemCollection/app/views/sub_categories/_form.html.erb where >> line #1 raised: >> >> nil is not a symbol >> Extracted source (around line #1): >> >> 1: <%= form_for(@sub_category) do |f| %> > > That suggests that @sub_category is nil. Is it? > > Fred
That was probably the problem since @sub_category was being set to SubCategory.find_by_id... so I will try and create it again and now just have it as one word to avoid confusion. -- 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 [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.

