Skip to content
main
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

devise-track_locale

Adds support to Devise for remembering a user's last locale.

Installation

Add the folling lines to your Gemfile:

# Remember the locale on user visits
gem "devise-track_locale"

Usage

Add a locale attribute to your users:

$ rails g migration AddLocaleToUsers locale
$ rake db:migrate

Save the locale on every sign-in

In your model, add :track_locale as a devise module:

class User < ActiveRecord::Base
  devise , :track_locale
end

Save the locale only once

In your model, add :track_default_locale as a devise module:

class User < ActiveRecord::Base
  devise , :track_default_locale
end

Copyright

By Sunny Ripert, under the MIT License. See LICENSE for details.

About

Adds support to Devise for remembering a user's last locale

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.