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 4120828
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:16:22+00:00 2026-05-20T23:16:22+00:00

I’ve been trying to setup Authlogic for the first time but I’m confused. I

  • 0

I’ve been trying to setup Authlogic for the first time but I’m confused.

I have set it up as per the example in the authlogic_example code however it doesn’t appear to run:

u = User.new(:password=>'testpass',
             :password_confirmation => 'testpass', 
             :email => 'test@test.com')
=> #<User id: nil, email: "test@test.com", created_at: nil, updated_at: nil, 
          first_name: nil, last_name: nil, crypted_password: nil, 
          password_salt: nil, persistence_token: nil>
 >> u.valid?
 => false
 >> u.errors
 => #< OrderedHash {:password=>["is too short (minimum is 4 characters)"], 
                    :password_confirmation=>["is too short 
                                            (minimum is 4 characters)"]}>

It looked like :password and :password_confirmation simply weren’t being set so in class User I made :password and :password_confirmation accessible attributes:

class User < ActiveRecord::Base
  acts_as_authentic
  attr_accessible :password, :password_confirmation # changed code
end

That worked:

>> u = User.new(:password=>'testpass',:password_confirmation => 'testpass', 
                :email => 'test@test.com')
=> #<User id: nil, email: "test@test.com", created_at: nil, updated_at: nil, 
          first_name: nil, last_name: nil, 
          crypted_password: "446edcbee34254ea83b8d469baef2dc34d723e710faf22efb97...", 
          password_salt: "hZFVKUo66meyrZ97Gb", 
          persistence_token: "b469fefd82a91683bf51b5eb9dbc15563b569a93ce973a42595...">
>> u.valid?
=> true

Whilst this worked, I’m concerned that I’ve been doing something wrong because in the authlogic_example, there are no attr_accessible set in user:

# Authlogic_example code
class User < ActiveRecord::Base
  acts_as_authentic
end

Why is it that the authlogic_example code works without explicitly setting the attributes to be being accessible but mine doesn’t?

  • 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-20T23:16:23+00:00Added an answer on May 20, 2026 at 11:16 pm

    I suddenly realised what caused my problem.

    I had previously changed the default setting for mass_assignment in a config file to enforce that all attributes were protected unless declared otherwise.

    An obvious mistake in retrospect but hopefully this might save someone else some time too

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

Sidebar

Related Questions

No related questions found

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.