Hi, I have the following code, a very basic textfield with a submit button: <%= form_tag({:controller => "job", :action => "index"}, :method => ''get'') %> <%= text_field_tag ''province'', @province %> <%= submit_tag "search" %> <%= end_form_tag %> In my routes.rb file I have: map.connect ''job/:province'', :controller => ''job'', :action => ''index'' So now when I submit the form I suspect the URL to become http://localhost:3000/job/1, but instead it becomes http://localhost:3000/?province=1&commit=zoeken. Does anybody know how I can get it to become the first URL. I really need this, because otherwise, the whole caching system breaks. Thanks. Kind regards, Nick -- Posted via http://www.ruby-forum.com/.
Nick Snels wrote:> Hi, > > I have the following code, a very basic textfield with a submit button: > > <%= form_tag({:controller => "job", :action => "index"}, :method => > ''get'') %> > <%= text_field_tag ''province'', @province %> > <%= submit_tag "search" %> > <%= end_form_tag %> > > In my routes.rb file I have: > > map.connect ''job/:province'', :controller => ''job'', :action => ''index'' > > So now when I submit the form I suspect the URL to become > http://localhost:3000/job/1, but instead it becomes > http://localhost:3000/?province=1&commit=zoeken. Does anybody know how I > can get it to become the first URL. I really need this, because > otherwise, the whole caching system breaks. Thanks. > > Kind regards, > > NickThe problem is browser side. It sees a form action of "/job" and just tacks the get params onto it. Maybe you could use javascript to alter the action of the form. -- Posted via http://www.ruby-forum.com/.