Issues with us_states and selected

I’m having some issues with the us_states plugin but it is probably
because I don’t know what I’m doing.

Here’s my code:

<% form_tag ‘/contact/list’ do -%>
<%= text_field_tag “searchName”, “”, :size => 15, :maxlength => 50 -
%><%= submit_tag “Search” %>
<% if !params[:state].nil? %>
<%= us_state_select(“state”, “abbr”, {:include_blank =>
true, :selected => params[:state][:abbr]}) %>
<% else %>
<%= us_state_select(“state”, “abbr”, {:include_blank => true}) %>
<% end %>
<% end -%>


<%= debug params %>

I’ve tried various incarnations of the :selected option and am at a
loss. :include_blank works just fine, though.

Does anyone have any suggestions?

I changed to using a select_tag and this seems to have fixed my
issue. I’m not sure why it didn’t work before, though:

<%= select_tag( :state,
us_state_options_for_select(params[:state], :include_blank => true) )
%>