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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:22:41+00:00 2026-05-26T04:22:41+00:00

I am just beginning to learn Ruby and have the following code in a

  • 0

I am just beginning to learn Ruby and have the following code in a project:

USER_ATTRS = [:login, :password, :lastname, :firstname, :mail, :admin]

What does this do? Where do :login and all the other things come from?

Are they just properties of a class (user, probably)?

Can someone can help me out please? Because I can’t really find this on the net.

  • 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-26T04:22:41+00:00Added an answer on May 26, 2026 at 4:22 am

    The short answer is:

    “The ‘:’ indicates a Ruby symbol’


    The medium length answer would add:

    Symbols are immutable objects that differ from strings in important ways.


    The Real Answer:
    You will have to learn Ruby to learn Rails. I also labored under the impression that I could just pick-up Rails and leave Ruby as just one more language under my belt. I was wrong. Ruby is different. I could point out how it is interpreted and makes use of open classes, but this isn’t the real reason you too will have trouble “learning as you do’ with Ruby and Rails. Ruby allows for a kind of syntactical overloading that some call ‘syntactic sugar’ It is one way to make Ruby code shorter and more readable. It will also hinder your ability to simply infer functionality from the code you see. You will see many well conceived Rails examples that leave you puzzled and eventually frustrated. These examples will look terse and mysterious and you may wonder, “Why don’t they just make it more intuitive?” The answer is many will also look at those same examples and say, “That’s good Ruby.” They have their reasons.

    The Remedy:
    Read. http://www.manning.com/black2/ and and http://pragprog.com/book/ppmetr/metaprogramming-ruby This rails book http://pragprog.com/book/rails4/agile-web-development-with-rails and these guides http://guides.rubyonrails.org/ then took me where I needed to go.

    What makes this point best? If you haven’t yet, work through this outstanding tutorial http://ruby.railstutorial.org/ruby-on-rails-tutorial-book It is one of the best programming tutorials I have ever read. It covers Rails very well and says some things about Ruby. Yet, it fails. If it is the only source you work from, you will not know enough Ruby to progress to the point where you can generate your own code.

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

Sidebar

Related Questions

I am just beginning to learn SQL and have stumbled at the first hurdle,
I'm just beginning with C++, so I'm looking some code to learn. I found
I am just beginning to try to learn C and have been trying to
I'm just beginning to (hopefully!) learn programming / ruby on rails and trying to
I'm just beginning to learn Java and I have been very frustrated about learning
I am just beginning to learn command line scripts, and I have an assignment
We are just beginning to learn and evaluate Mercurial, due to an increasing number
I'm just beginning to learn python. I wrote an example script to test OOP
I'm just beginning to have a look at Objective-C and Cocoa with a view
I'm just beginning to use Regex so bear with my terminology. I have a

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.