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

  • Home
  • SEARCH
  • 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 9123567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:22:18+00:00 2026-06-17T06:22:18+00:00

I am following a rails tutorial and in my class User < ActiveRecord::Base I

  • 0

I am following a rails tutorial and in my class User < ActiveRecord::Base I am writing the following code to make the email address down case:

before_save { |user| user.email = email.downcase }

But what are the significance of this |user| in ruby? Previously I have seen it inside a ruby loop. I am not getting a proper keyword for search.

Thankyou.

  • 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-17T06:22:19+00:00Added an answer on June 17, 2026 at 6:22 am
    { |user| user.email = email.downcase }
    

    This is a block. user is a block parameter. before_save is a method that takes a block, saves it and calls later, passing current instance of User as parameter.

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

Sidebar

Related Questions

I have the following code for my user model: class User < ActiveRecord::Base has_secure_password
Hi (huge Rails newbie here), I have the following models: class Shop < ActiveRecord::Base
I'm new to Rails and was following Ryan Bate's tutorial on how to make
I am following Lynda ruby on rails tutorial. Here is the code I have
I'm following this tutorial http://ruby.railstutorial.org/ruby-on-rails-tutorial-book My question is, what is the relation for user
I'm following the Rails Tutorial (Hartl), and having some trouble in section 3.6.4 Tests
Taking a rails tutorial, and I've run into the following problem that I'm having
I've been following the Ruby On Rails Tutorial and tried to get rid of
I'm following the Ruby on Rails tutorial and I'm on chapter 2. When I
I'm following Michael Hartl's Rails Tutorial at the moment and I've managed to 7.22

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.