I am trying to figure out how to use the “select” helper in changing a
scaffold produced “new.html.erb” file. Specifically how do I change:
Year In School:
<%= f.text_field :year %>
so that this shows up as a “drop down box”.
I’ve tried different variations of
<%= f.select :year %>
but that never works.
Any help?
[email protected] wrote:
I am trying to figure out how to use the “select” helper in changing a
<%= f.select :year %>
but that never works.
Any help?
try this
<%= f.select :year ,Time.now.year-100…Time.now.year %>
Nope, that doesn’t work. To clarify, the year part is supposed to be a
pull down select menu of “Senior, Junior, Sophomore, Freshman”
On Oct 29, 10:11 pm, Thani A. [email protected]
That did it, thanks
On Oct 29, 10:43 pm, Thani A. [email protected]
[email protected] wrote:
Nope, that doesn’t work. To clarify, the year part is supposed to be a
pull down select menu of “Senior, Junior, Sophomore, Freshman”
On Oct 29, 10:11�pm, Thani A. [email protected]
what is the error ? post it here.
what is your rails version?
and try this
<%= select :obj,:year ,%w{Senior Junior Sophomore Freshman} %>