Have you ever had a select box with ActiveRecord id:s as option values and a param from the params hash as selection? Something like this:
<% form_tag do %> <%= select_tag(:category_id, options_for_select(Category.all.map { |c| [c.name, c.id] }, params [:category_id])) %> <%= submit_tag %> <% end %>
I doesn't work since values in the params hash are strings and model ids are integers. I've patched the option_value_selected? method to do comparisons on strings rather than objects:
Comments on this?
Thanks!
Peter Marklund http://marklunds.com