# using form\_tag with a get request with params

**URL:** <https://discuss.rubyonrails.org/t/using-form-tag-with-a-get-request-with-params/5710>\
**Category:** rubyonrails-talk\
**Created:** [December 11, 2006, 8:54pm UTC](https://discuss.rubyonrails.org/t/using-form-tag-with-a-get-request-with-params/5710 "2006-12-11T20:54:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Weber](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Mike\_Weber](https://discuss.rubyonrails.org/u/Mike_Weber)\
**Post date:** [December 11, 2006, 8:54pm UTC](https://discuss.rubyonrails.org/t/using-form-tag-with-a-get-request-with-params/5710/1 "2006-12-11T20:54:19Z")

</div>

all I can think of is that order of routes matters, and there may be a conflict with the default :controller:action scheme. try moving it up the list, but be careful that it doesn’t break the rest of your routes.

---

<div class="post-metadata">

**Author:** ![Bruce\_Woodward](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@Bruce\_Woodward](https://discuss.rubyonrails.org/u/Bruce_Woodward)\
**Post date:** [December 12, 2006, 12:59pm UTC](https://discuss.rubyonrails.org/t/using-form-tag-with-a-get-request-with-params/5710/2 "2006-12-12T12:59:54Z")

</div>

Well, besides connect being spelt with three n's I don' think that there is anything wrong with your code. And rails is behaving exactly as expected too. When the form is created, I believe that rails will generate html like this (it did when I looked at your code); \<form action="/products/search" method="get"\> \<input id="term" name="term" type="text" value="fred" /\> \<input type="submit" value="search" /\> \</form\> So, "term" is supposed to vary depending upon what the user keys in but then "term" is also supposed to appear into the html before the user types in anything. I don't think that there is much change of that working. The URL generated from the form is fine. [http://localhost:3004/products/search?term=something](http://localhost:3004/products/search?term=something) is correct.

The routing is working. You can see this if add some code to the search.rthml view that displays the value of the params[:term]. Also a URL like [http://localhost:3004/products/search/here-is-my-term](http://localhost:3004/products/search/here-is-my-term) works. params[:term] is set to "here-is-my-term" in the search method of the controller. When the user then keys in a value into the form and clicks the submit button, the URL becomes [http://localhost:3004/products/search/here-is-my-term?term=&lt;some](http://localhost:3004/products/search/here-is-my-term?term=&lt;some) user entered value\>

Maybe dropping the route and just letting the form do it's thing is the simplest way forward?

regards, Bruce.
