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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:06:09+00:00 2026-06-11T12:06:09+00:00

Devise’s examples and tutorials say me to have something like this in User model:

  • 0

Devise’s examples and tutorials say me to have something like this in User model:

attr_accessible :name, :password, :password_confirmation, :remember_me

So I have two questions about this.

  1. Why should I make “name” and “password” accessible? I want them to be protected, does devise let me change this?

  2. What on earth do fields like “password_confirmation” and “remember_me” do in user model? Now I can write something like User.find(1).password_confirmation, it works but has no sense at all.

How to deal with that?

  • 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-06-11T12:06:10+00:00Added an answer on June 11, 2026 at 12:06 pm

    I think I’ve found an answer.

    1. Devise uses mass-assignment, and there is nothing you can do about that. There is a Github issue about that: https://github.com/plataformatec/devise/pull/718. I’m working on idea how we can change Devise to avoid it relying on mass-assignment. I will be happy to know your opinion.

    2. As long as Devise takes away your right to define our attr-accessible list, there are two things you can do about that:

      a. You can just use attr_readonly along with attr_accessible. It will open door for Devise, but not for your other forms, read Make attributes mass assignable only during creation

      b. def mass_assignment_authorizer allows you to define dynamic attr-accessible list, read http://railscasts.com/episodes/237-dynamic-attr-accessible?view=asciicast. IMHO, this way is overkill for this kind of problem.

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

Sidebar

Related Questions

I have a standard devise user model with the usual fields. This is for
In Devise , I'm signing in my user like this: sign_in_and_redirect(:user, user) In the
Using devise , I have a User model. I do not have a user
I'm using Devise for user authentication and basic authentication. Let's say I have defined
Devise allows user email lookups. This is a certain privacy issue. The problem is
Have converted devise new session from erb to Haml but doens't work, this is
In Devise, if I change user's password and after it gets updated in the
in devise, the forms look like this: form_for(:resource, @resource, :url => edit_user(resource), :html =>
I have devise/omniauth set up and now I would like to use the Facebook
I'm and usings devise for my authentication and would like to keep the details

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.