First, thanks to everyone who replied to my pluralization question
Today I was trying to do what I think is called a “chained accessor”.
I have an “events” table and each event has one user. Instead of
seeing the id number for each event’s user, I’d rather display the
names of users instead. I tried to do this:
class Event < ActiveRecord::Base
class User < ActiveRecord::Base
in the event_controller.rb:
@users = User.find(:all)
@events = Event.find(:all)
in the list.rhtml:
<% @events.each do |eachevent| %>
But I get an error saying “You have a nil object when you didn’t
expect it! The error occured while evaluating nil.name”
What am I doing wrong? Thanks in advance for all replies!