Form select should d string equality rather than object equality

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( { |c| [,] }, 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?


Peter Marklund