I have a select with values of company names. But I use the id from that
table in the select list in the form, not names. I get it with:
@userlist = User.find(:all, :order => “company”).map { |s|
[s.company,s.id]}
If I want to get the company name, also in that table, how do I do that?
Can I have a hidden field and tell that to get the company name from the
selected id of @userlist directly? Or should I have something in the
following action where the record is created, picking up the company
name?
I hope you understand. I have some problem with the logic here In
php I would normally have a mysql select in the action after the form to
get the selected value. However, I have a feeling that there is a
smarter way in RoR.