OK, thanks to Kelly I got my options_for_select in a select_tag
helper method to use a Ruby range as a value. Now when the user makes
a selection from that list, I can’t figure out why the result doesn’t
get stored in the database.
The line in the _form looks like this:
<%= select_tag(:month, options_for_select((0…12).to_a)) %>
Pops up an option menu. There’s a column in the database called
“month.” It’s defined as an integer. So I would expect Rails just to
take the user’s selection and stuff it into that column of the table.
But nothing gets placed there at all.
I’m obviously missing something. I went into irb and typed:
x = (1…12).to_a
[1 2 3 4 5 6 7 8 9 10 11 12]
So I am pretty sure the array holds integers. What’s the missing link?