Dirk Bergmann

Developer, panographer. Does consultancy work from own company. Lives in Chiang Mai, Thailand.

Twitter

Chiang Mai

Hua Hin

Thailand Hotels

ListVote - List. Vote. Learn.

Partnerseek - Find Partners

Using routing_filter with Devise

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.