Do I have to pass the ID-parameter when using respond_to?

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!

On Jan 31, 2008 11:54 AM, Gu stav [email protected]
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/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs