This is a cross post from the fg mailing list but the traffic is very low there so I thought I''d try here, too. While running a test with Cukes/FG, I pre populate a table (event_categories), run my test and it passes on a successful failure (duplicate record) When the controller executes ... render {:action => :new}, I get the following error ..... You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.inject (ActionView::TemplateError) On line #10 of app/views/event_types/_form.html.erb 9: <%= form.label :event_category_id, ''Event Categories'' %> 10: <%= form.select :event_category_id, @event_categories %> Does anyone know what I have to do to preserve my data? CIA -ants -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Solved. Sorry to take up bandwidth :( On 20 July 2010 12:36, Ants Pants <antsmailinglist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This is a cross post from the fg mailing list but the traffic is very low > there so I thought I''d try here, too. > > While running a test with Cukes/FG, I pre populate a table > (event_categories), run my test and it passes on a successful failure > (duplicate record) > > When the controller executes ... render {:action => :new}, I get the > following error ..... > > You have a nil object when you didn''t expect it! > You might have expected an instance of Array. > The error occurred while evaluating nil.inject (ActionView::TemplateError) > On line #10 of app/views/event_types/_form.html.erb > > 9: <%= form.label :event_category_id, ''Event Categories'' %> > 10: <%= form.select :event_category_id, @event_categories %> > > Does anyone know what I have to do to preserve my data? > > CIA > > -ants >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ants Pants wrote:> Solved. Sorry to take up bandwidth :(Solved how? Please explain so others can learn. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 20 July 2010 14:49, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Ants Pants wrote: > > Solved. Sorry to take up bandwidth :( > > Solved how? Please explain so others can learn. > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > I didn''t want to advertise my stupidity ;)in my create action, I was repopulating the event_categories list after a successful save. In this instance, I was actually testing for a failure so the list never got touched. Believe me, if I had a nugget of inspiration, I would''ve informed the list. Sorry for the vagueness in my solved reply. -ants -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.