I''m trying to do something that is probably super simple but
I''ve not done
it yet in Rails and my attempts so far have resulted in a very hacky
solution.
Basically I want a form that when submitted (GET), changes what is displayed
on the page as such:
The pages contents are fetched from the database using the standard Rails
route:
:controller/:action/:id
<form action="whatever" method="get">
<select name="whatever">
    <option value="1">Name 1<option>
    <option value="2">Name 2<option>
</select>
</form>
I tried using collection_select, as the select will be populated from an
array of AR objects... My code looked like this:
<%= start_form_tag({:action => ''index'', :id => nil},
:method => "get") %>
<%= collection_select(:id, nil, @artists, :id, :display_name) %>
<input type="image" name="bandsubmit"
src="/fat/img/tours/go.gif" />
<%= end_form_tag %>
This works but it produces a really hacky looking URL since it is encoding
the [] that collection_select but in the select name:
<select id="id_" name="id[]">
1. How do I get rid of the [] generated by the collection select?
2. Is there a better method for this?
Thanks