Rails3 I18n locale in urls

As per the Rails 3 I18N documentation, I wrote in my routes.rb

scope "(/:locale)", :locale => /en|nl/ do     resources :users end match '/:locale' => 'home#index' root :to => "home#index"

and in my ApplicationController.rb before_filter :set_locale   def set_locale     I18n.locale = params[:locale]   end   def self.default_url_options(options={})     {:locale => I18n.locale}   end

but I sill get urls with the locale parameter as if the scope was ignored ...


I rather should get : http://localhost:3000/en/users/sign_in

( I am using also Devise 1.2...)

what could be wrong ? thanks for your suggestions

the clue was in my question ..... I am using Devise .. so I should scope the devise for :

  scope "(:locale)", :locale => /en|nl/ do       devise_for :users .....   end