On Jul 5, 10:54 am, "Älphä Blüë" <[email protected]>
wrote:
> I took a break from this issue and tried to get back to it again today.
> I even tried implementing hidden fields but that doesn't work as
> expected. Can anyone offer input into this issue? Advice?
> Suggestions?
>
> 1. What options do I have for building a form using form_tag with
> params.merge?
>
> I have looked through a lot of sites online and
>
> <% form_tag(params.merge(:compiled_on => params[:compiled_on]), :method
> => 'get') do %>
> <%= hinted_text_field_tag :search, params[:search], "Enter Team" %>
> <%= submit_tag "Team Search", :name => nil %>
> <% end %>
>
> .. should work..
>
> However, it does not. I still only get search="Florida" and I don't get
> search="florida"&compiled_on="2009-07-02"..
>
If a form's submission method is get, then when you submit the form
its input elements are serialized and turned into a query string. The
standard just say that a ? and this query string is appended to the
action attribute (which would probably create an invalid url such as
foo?bar=baz?search=Florida ). In practise most browsers seem to just
ignore the query string that was part of the action attribute,
although I can't see anything in the standards that says this is ok
(equally I can't see anything that says that the query strings need to
be concatenated in a smart way). Given that the browser is going to
junk the query string bit from the form's action attribute you'll need
all of your various parameters as form parameters (unless you have
routes which push those parameters into the path of the url)..
Fred
> I hate bumping my own thread but either this is a very easy issue or
> it's a very complicated issue and no one has any advice for me. I've
> worked through this issue as far as I can by myself. I need some
> assistance.
>
> Thanks.
> --
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---