Skip to content

sunny/devise-track_locale

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

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

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

Stars

Watchers

Forks

Packages

No packages published

Languages