11155
(-- --)
February 10, 2010, 3:00pm
1
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!
11155
(-- --)
February 11, 2010, 11:32pm
2
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.
11155
(-- --)
February 12, 2010, 1:33am
4
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 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
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 => …”