Can't pass parameters in routes on Rails 3

Hi all!

In Rails 2.3, I could do the following:

map.connect “/posts/favorites”, :controller => :posts, :action =>
“:index”, :filter => “favorites”

But it seems that the “match” command in Rails 3 doesn’t accept
parameters. So, the following doesn’t work:

match “/posts/favorites” => “posts#index”, :filter => “favorites”

Is there any way to pass a parameter in route like in 2.3 ?

Thank you!

Sorry to ask again, but no one know how to do this? I have read all the
routes section in Rails Guides ( rails.info )
but didn’t find a way to pass parameters in routes.

Maybe this feature was removed from Rails 3?

On Thu, Feb 11, 2010 at 5:32 PM, Henrique T. [email protected]
wrote:

Sorry to ask again, but no one know how to do this? I have read all the
routes section in Rails Guides ( rails.info )
but didn’t find a way to pass parameters in routes.

Maybe this feature was removed from Rails 3?

I’d file a bug report… if it’s missing on purpose they will surely tell
you.


Greg D.
destiney.com | gregdonald.com

This has been around for a long time, but just in case somebody stumbles
across it like I did, it should be “:defaults => …” not “default =>
…”

I’d file a bug report… if it’s missing on purpose they will surely tell
you.

Just discovered a way, using :default => { :filter =>“favorites” }

Unfortunately, it doesn’t work :slight_smile: But it is on Rails Guides. I just
filled a bug report here
https://rails.lighthouseapp.com/projects/16213/tickets/119-default-route-option-doesnt-work