I'm trying to figure out the best way to do this:
I have an Artist model
I want to create a dropdown list of all the artists in the database.
When you select one of them form the list, you get redirected to their
respective "show" action.
In my routes.rb (using REST)
map.resources :artists
In my controller:
@artists = Artist.find(:all, :order => "name")
In my view:
<% form_for(:artist, :url => artist_path(@artist), :html => {:method
=> :get}) do |f| %>
<%= f.collection_select('id', @artists, 'id', 'name') %>
<%= submit_tag "go!" %>
<% end %>
now, of course, this doesn't work. When submitted, you just get sent
to the first @artist.id "show" action. I've been racking my brain
trying to figure out how to do this in Rails.