RailsGrunt

a noob working the ruby railroad.

rails select tag with numbers

March 2nd, 2007

if you have a form and need a select list of numbers, here is a slice of code i use…

<%= select_tag :expnum, options_for_select((7..90).collect {|x| [x, x] }, :expnum) %>

So now you can access expnum in your controller view params[:expnum]

Sorry, comments are closed for this article.