# Do I have to pass the ID-parameter when using respond\_to?

**URL:** <https://www.ruby-forum.com/t/do-i-have-to-pass-the-id-parameter-when-using-respond-to/127719>\
**Category:** Rails\
**Created:** [January 31, 2008, 6:54pm UTC](https://www.ruby-forum.com/t/do-i-have-to-pass-the-id-parameter-when-using-respond-to/127719 "2008-01-31T18:54:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gustav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/919ad9/32.png) [@gustav](https://www.ruby-forum.com/u/gustav)\
**Post date:** [January 31, 2008, 6:54pm UTC](https://www.ruby-forum.com/t/do-i-have-to-pass-the-id-parameter-when-using-respond-to/127719/1 "2008-01-31T18:54:35Z")

</div>

Hi,  
I would like to append “.rss”, straight to my action, ex.  
“/controller/action.rss”. However it seems that I have to use  
“host/action/1.rss” (or another ID-parameter), otherwise I get a routing  
error "No route matches “/controller/action.rss” with {:method=\>:get}

What am I missing?

Thanks!

---

<div class="post-metadata">

**Author:** ![gustav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/919ad9/32.png) [@gustav](https://www.ruby-forum.com/u/gustav)\
**Post date:** [February 1, 2008, 10:46pm UTC](https://www.ruby-forum.com/t/do-i-have-to-pass-the-id-parameter-when-using-respond-to/127719/2 "2008-02-01T22:46:06Z")

</div>

On Jan 31, 2008 11:54 AM, Gu stav [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,  
> I would like to append “.rss”, straight to my action, ex.  
> “/controller/action.rss”. However it seems that I have to use  
> “host/action/1.rss” (or another ID-parameter), otherwise I get a routing  
> error "No route matches “/controller/action.rss” with {:method=\>:get}

Add a custom route, something like:

map.connect ‘foo/:rss’,  
:controller =\> ‘foo’,  
:action =\> ‘bar’,  
:requirements =\> { :rss =\> /^[\w]+.rss$/ }

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)
