Using routing_filter with Devise

Ruby on Rails Add comments

Having used Sven Fuchs’ routing_filter to localize routes (see here for alternative solutions), I now moved my authentication to devise from authlogic. This broke my localized routes with the default configuration, so for example

http://localhost:3000/en/users/sign_in

failed with an

ActionController::UnknownAction

error.

Fixing it was super-easy, simply open your config/initializers/devise.rb file and uncomment (currently line 81)

config.use_default_scope = true

and it should work like before.

Note that this works only with Rails 2.+, not with Rails 3 where it’s probably better to use a scope block to prepend locales to you routes, instead of the routing_filter plugin.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in