when the user click on "Search" I would like it to point to http://curentpage/?filter=searchtext (the filtering code is already written) it would look like this: <%= start_form_tag(url_for_options = {<something>}) %> <%=text_field (<my_filter>) %> <%= submit_tag(value = "Search")%> any idea how to do this? thanx in advance
Mark Reginald James
2006-May-15 11:16 UTC
[Rails] Re: need help for simple form tag (noob)
Patrick Aljord wrote:> when the user click on "Search" I would like it to point to > http://curentpage/?filter=searchtext (the filtering code is already > written) > > it would look like this: > > <%= start_form_tag(url_for_options = {<something>}) %> > <%=text_field (<my_filter>) %> > <%= submit_tag(value = "Search")%> > > any idea how to do this?<%= form_tag({}, :method => ''get'') %> <%= text_field_tag ''filter'' %> <%= submit_tag ''Search'' %> <%= end_form_tag %> -- We develop, watch us RoR, in numbers too big to ignore.
On 5/15/06, Mark Reginald James <mrj@bigpond.net.au> wrote:> > Patrick Aljord wrote: > > when the user click on "Search" I would like it to point to > > http://curentpage/?filter=searchtext (the filtering code is already > > written) > > > > it would look like this: > > > > <%= start_form_tag(url_for_options = {<something>}) %> > > <%=text_field (<my_filter>) %> > > <%= submit_tag(value = "Search")%> > > > > any idea how to do this? > > > <%= form_tag({}, :method => ''get'') %> > <%= text_field_tag ''filter'' %> > <%= submit_tag ''Search'' %> > <%= end_form_tag %> > > ok thanx a lot, I''m using params[:filter] in my controller and it worksgreat. Now I''m trying the post method like this: <%= form_tag({}, :method => ''get'') %> <label class="required" for="document_filter">test autocomplete</label> <%= text_field_with_auto_complete :stage, :sujet %> <%= submit_tag ''Search'' %> <%= end_form_tag %><p> the autocomplete part works great but how can I get the posted value? I get a url like ''?object%5Bmethod%5D=textvalue'' thanx in advance Pat -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060516/0198ee6c/attachment.html
Mark Reginald James
2006-May-16 23:43 UTC
[Rails] Re: need help for simple form tag (noob)
Patrick Aljord wrote:> Now I''m trying the post method like this: > > <%= form_tag({}, :method => ''get'') %> > <label class="required" for="document_filter">test autocomplete</label> > <%= text_field_with_auto_complete :stage, :sujet %> > <%= submit_tag ''Search'' %> > <%= end_form_tag %><p> > > the autocomplete part works great but how can I get the posted value? I > get a url like ''?object%5Bmethod%5D=textvalue''This''d probably work: <%= text_field_with_auto_complete :stage, :sujet, :name => ''filter'' %> -- We develop, watch us RoR, in numbers too big to ignore.