Named REST routes and extra parameters

Hi,

Is there a way to pass additional parameters to named REST routes so
that they get appended to the URL? For example, if I have a
post_url(@post), can I somehow tell Rails to append another parameter?

/posts/23?extra_param=hello

What I have been doing is use url_for instead:

url_for(:action => ‘show’, :id => @post, :extra_param => ‘hello’)

But that’s long!

Ingo

Ingo W. wrote:

Hi,

Is there a way to pass additional parameters to named REST routes so
that they get appended to the URL? For example, if I have a
post_url(@post), can I somehow tell Rails to append another parameter?

/posts/23?extra_param=hello

What I have been doing is use url_for instead:

url_for(:action => ‘show’, :id => @post, :extra_param => ‘hello’)

But that’s long!

Ingo

if its something specific add a second route on top of the existing one
and make the new field required that way if the smaller route is
requested it will skip over the new one. however if the required
parameter is attached the router will stop at the correct routing
address.