Folks
When im in rails 3.2 console i can do this just fine
p = Person.last
p.last_name
and it prints the last name.
But when i try to find it by the id, its able to locate the single
record and store it in my variable p, but i cant print the last_name
column. For example.
p = Person.where(id: 34).limit(1)
"printing p here shows all the columns"
p.last_name says this
NoMethodError: undefined method `last_name' for
#<ActiveRecord::Relation:0x000000055f8840>
any help would be appreciated, thanks.
--
Posted via
http://www.ruby-forum.com/.