Method: Authlogic::Session::Config::ClassMethods#login_field
- Defined in:
- lib/authlogic/session/config.rb
#login_field(value = nil) ⇒ Object Also known as: login_field=
The name of the method you want Authlogic to create for storing the login / username. Keep in mind this is just for your Authlogic::Session, if you want it can be something completely different than the field in your model. So if you wanted people to login with a field called “login” and then find users by email this is compeltely doable. See the find_by_login_method configuration option for more details.
-
Default:
Uses the configuration option in your model: User.acts_as_authentic_config -
Accepts:
Symbol or String
170 171 172 173 174 175 176 |
# File 'lib/authlogic/session/config.rb', line 170 def login_field(value = nil) if value.nil? read_inheritable_attribute(:login_field) || login_field(klass.acts_as_authentic_config[:login_field]) else write_inheritable_attribute(:login_field, value) end end |