Well since Event.all should have returned an array and not thrown an error, my guess is there is a problem with your model/database. Go into the terminal and open up a session using script/console, at the prompt enter Event.all and see what it returns...
On Aug 20, 1:51 pm, spokra <[email protected]> wrote: > in application controller > > @upcomingevents = Event.all > > in application layout > > <% @upcomingevents.each do |upcomingevent| %> > <%= upcomingevent.name %> > <% end %> > > there are events.. but i get an error of > > ActionView::TemplateError (undefined method `each' for nil:NilClass) > on line #77 of app/views/layouts/application.html.erb: > 74: <%= content_tag :p, msg, :class => key, :id => key -%> > 75: <% end -%> > 76: > 77: <% @upcomingevents.each do |upcomingevent| %> > 78: <%= upcomingevent %> > 79: <% end %> > 80: <div id="content" class="content"> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

