Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4239038
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:58:56+00:00 2026-05-21T02:58:56+00:00

I am trying (unsuccessfully) to setup Authlogic for my Rails3 project. In the user_sessions#new

  • 0

I am trying (unsuccessfully) to setup Authlogic for my Rails3 project. In the user_sessions#new view, I keep getting the following error:

undefined method `login' for #<UserSession: no credentials provided>
Extracted source (around line #7):

5:   <%= form_for(:user_session, :url => user_session_path) do |f| %>
6:     <%= f.label :login %><br>
7:     <%= f.text_field :login %><br>
8:     <%= f.password_field(:password) %>   
9:     <%= f.submit %>
10:   <% end %>

I believe that the error is coming because Authlogic is failing to detect which database column should be used for the login field.

I was under the understanding that Authlogic is supposed to fall back on the :email column if no login column is present. For belt and braces I tried adding a config option to the User class but it still did not solve the problem

Here is my code:

User model

class User < ActiveRecord::Base

  attr_accessible :password, :password_confirmation
  acts_as_authentic do |c|
    c.login_field = :email
  end
end

UserSessions controller

class UserSessionsController < ApplicationController  
  def new
    @user_session = UserSession.new
  end

  # ...
end

UserSessions#new view

<%= form_for(:user_session, :url => user_session_path) do |f| %>
  <%= f.label :login %><br>
  <%= f.text_field :login %><br>
  <%= f.password_field(:password) %>   
  <%= f.submit %>
<% end %>

UserSession model

class UserSession < Authlogic::Session::Base
   # configuration here, see documentation for sub modules of Authlogic::Session
end

DB Schema (for authlogic tables)

create_table "sessions", :force => true do |t|
  t.string   "session_id", :null => false
  t.text     "data"
  t.datetime "created_at"
  t.datetime "updated_at"
end

add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"

create_table "users", :force => true do |t|
  t.string   "email"
  t.datetime "created_at"
  t.datetime "updated_at"
  t.string   "first_name"
  t.string   "last_name"
  t.string   "crypted_password"
  t.string   "password_salt"
  t.string   "persistence_token"
end

Why won’t Authlogic use the login column I tell it to (or is this even the problem)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T02:58:57+00:00Added an answer on May 21, 2026 at 2:58 am

    You’re telling AuthLogic to use the email field, but then using the login field in your view instead. Change your view to:

    <%= form_for(:user_session, :url => user_session_path) do |f| %>
      <%= f.label :email %><br>
      <%= f.text_field :email %><br>
      <%= f.password_field(:password) %>   
      <%= f.submit %>
    <% end %>
    

    and it should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to setup git for our web development team unsuccessfully. Some
I am trying unsuccessfully to extract the formatted_address property. The following web service logs
I'm trying to get benefits of view collation in CouchDB unsuccessfully, could some one
I am trying to run the following script (unsuccessfully): $variables = $db->query(SELECT * FROM
Ive been trying unsuccessfully for a few days now to get a button to
I am trying (unsuccessfully) to use sp_send_dbmail (Transact-SQL) . The @recipients value is said
I'm using Django templating with Google App Engine. I'm trying unsuccessfully to print out
I'm trying to link with the static libc.a and a dynamic lib .so unsuccessfully.
I'm new to rails! Ok, I am trying to set up a user signup
I've been trying unsuccessfully to filter a collection of child objects for a few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.