what is the "resort.id" in "resort_path(resort.id)? it has no value..
also, im not sure its a good idea to submit a form for a simple get request like this. forms and get requests, as far as i can imagine, go well together for something like a search. try something like this.. <%= select_tag(:resort, "<option>-Select a resort</ option>"+options_from_collection_for_select (@resorts, :id, :name), :onchange => "new Ajax.Request('/resorts/', {asynchronous:true, evalScripts:true, method:'get', parameters:'id=' + encodeURIComponent(value)})"%> im not sure if the ajax request uri is correct for the show action, u may have to look it up. what this does is, on change of the selection, it shoots off an ajax request to the resorts controller show action with the id of the resort selected. the rest will be done by the controller show action. good luck! On Aug 1, 6:01 pm, bingo bob <rails-mailing-l...@andreas-s.net> wrote: > on my homepage i'd like a drop down. > > The ser selects the resort and it should go to the resorts show action > > the following code doesnt work ! > > how do i do it. > > rake routes shows me > resort GET /resorts/:id(.:format) {:controller=>"resorts", > :action=>"show"} > > simples? > > <% if @resorts %> > <% form_tag resort_path(resort.id), :method => :get do %> > <%= select_tag(:resort, "<option>-Select a resort..</option>" + > options_from_collection_for_select(@resorts, :id, :name)) %> > <%= submit_tag "Go" %> > <% end -%> > -- > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---