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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:02:19+00:00 2026-05-27T16:02:19+00:00

I am watching Ruby On Rails Live Lessons videos and the author defined an

  • 0

I am watching Ruby On Rails Live Lessons videos and the author defined an Active Record User model. In the model, he made password_confirmation field part of the model. Is this standard practise in RoR? Seems weird to me to define it as part of the model…

For example, you don’t define email confirmation as part of the model or maybe username confirmation.

Is this normal/standard RoR practise?

  • 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-27T16:02:20+00:00Added an answer on May 27, 2026 at 4:02 pm

    You can add virtual attributes (attributes that are in-memory only. They’re not backed by the database) to AR models.

    To the clients of the model, the attribute looks real, but it is not stored in the database.

    In the example, the password_confirmation attribute is virtual.

    Remember that there are two ways to think of a Rails User model:

    1. The User model describes what is in the database
    2. The User model handles interactions between the “Users” and the rest of the Rails application.

    Number 2 is the preferred way to build apps. It’s the idea behind the “Thick models, thin controllers” motto.

    So it often makes lots of sense to add virtual attributes to a model to enable mass setting of attributes from an incoming form. The real and virtual attributes are then used by the model’s methods as appropriate.

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

Sidebar

Related Questions

I found the following table structures while I was watching ruby on rails tutorial.
I'm trying RubyMine, and watching this tutorial https://www.jetbrains.com/ruby/documentation/ . The author uses there project->new->scaffold
I am new to ruby on rails and I have just started watching rails
I am new to ruby on rails and I have just started watching rails
Possible Duplicate: What does map(&:name) mean in Ruby? I was watching a railscast and
I was watching a tutorial on Rails and was very impressed that you could
I have just finished watching the following videos in an attempt to understand JDO
Recently I have been watching Plural Sight ASP.NET videos on data binding, and I
I just started watching the 2010-11 WWDC iPhone videos and so far love them,
Hey guys I'm following the rails tutorial found here http://net.tutsplus.com/tutorials/ruby/the-intro-to-rails-screencast-i-wish-i-had/ and I've gotten to

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.