David C. wrote:
> In this case you could create a helper in your application helper file
> that all views could access, since the languages aren''t really
tied to
> the user model from a db perspective.
>
> Then you could pass the helper the variable and have it return the
> appropriate result.
duh. thanks.
On a side note, it was a complete pain to try to figure out how to use
that hash in a select box withinin a view. Most existing helpers seem
to be designed to use an array or a collection of objects with exposed
methods to access value/description.
I ended up with the slightly hackish (but I thought really neat):
<%= collection_select(''user'',''language'',
languages, "first", "last")%>
--
Posted via http://www.ruby-forum.com/.