Displaying 1 result from an estimated 1 matches for "collection_for_select".
2007 Nov 28
5
methods in models dont work for views?
This question is more towards understanding how things work rather than
trying to just get something to work.
I have something like this in my user model.
def full_name
first_name + " " + last_name
end
This works find if I use it for display values in a
collection_for_select.
options_from_collection_for_select( @users, :id, :full_name)
It displays the full name in the selection box options.
But if I try to go <%=h @user.full_name %> I get an error saying
"private method `full_name'' called for <...>"
Do I need write a duplicate meth...