# Map.resources, format and additional params

**URL:** <https://www.ruby-forum.com/t/map-resources-format-and-additional-params/109168>\
**Category:** Rails\
**Created:** [July 12, 2007, 2:37am UTC](https://www.ruby-forum.com/t/map-resources-format-and-additional-params/109168 "2007-07-12T02:37:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addywaddy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@addywaddy](https://www.ruby-forum.com/u/addywaddy)\
**Post date:** [July 12, 2007, 2:37am UTC](https://www.ruby-forum.com/t/map-resources-format-and-additional-params/109168/1 "2007-07-12T02:37:32Z")

</div>

Hi,

I’ve hit an issue that has me a little surprised - basically, when I  
specify both a format and additional parameters in my URL, via something  
like:

/jobs.txt?q=Up

then params[:format] is set not to “txt” as I would expect, but to  
“txt?q=Up”. This in turn breaks my respond\_to logic, which works fine  
until additional parameters are added to the request URL.

I’ve simplified my routes.rb to the most basic case:

ActionController::Routing::Routes.draw do |map|  
map.resources :jobs  
end

It seems like this should be a fairly common scenario, so maybe there is  
another way I ought to be tackling this? Essentially, what I am trying  
to do is allow the list of resources that would be returned from a  
request to /jobs.txt to be filtered to only include those starting with  
the specified value…

Any suggestions?

Cheers,

Adam

---

<div class="post-metadata">

**Author:** ![addywaddy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@addywaddy](https://www.ruby-forum.com/u/addywaddy)\
**Post date:** [July 12, 2007, 3:26am UTC](https://www.ruby-forum.com/t/map-resources-format-and-additional-params/109168/2 "2007-07-12T03:26:02Z")

</div>

Ignore this post - it was a case of user error! (I was leaving out the  
“?” in the URL - D’OH!)
