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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:25:27+00:00 2026-05-24T05:25:27+00:00

I am in chapter 7 of the railstutorial.org, and the author is starting to

  • 0

I am in chapter 7 of the railstutorial.org, and the author is starting to explain less and less of the syntax and details of the course.

I dont understand the following syntax he uses when creating a user with Factory Girl:

 Factory.define :user do |user|
  user.name                  "Michael Hartl"
  user.email                 "mhartl@example.com"
  user.password              "foobar"
  user.password_confirmation "foobar"
end

I am not copying and pasting the code, so initially, after reading, I wrote my code like this:

user.name = 'Michael Hartl'
etc

and the tests didnt run. After rereading that section, I saw that the author doesnt use the =. What does this mean? If I understood correctly, Factory girl creates a instance of User, and then assigns it these attributes. So how is user.name = ‘whatever’ incorrect?

I really hate not understanding stuff when doing tutorials, so I’m stuck here until I make sense of it…

  • 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-24T05:25:28+00:00Added an answer on May 24, 2026 at 5:25 am

    This: user.name = 'Michael Hartl' doesn’t work, because the creator of Factory Girl chose a different syntax, namely: user.name "Michael Hartl". I guess you just have accept that Factory Girl works like this. If you want to know why you have to ask the creator.

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

Sidebar

Related Questions

I am following the Ruby on Rails Tutorial (http://ruby.railstutorial.org) . In Chapter 3, the
I am following Michael Hartl's Screencasts from railstutorial.org. According to chapter 5, I changed
I'm following the rails tutorial @ http://railstutorial.org On chapter 11, I'm having issues with
I'm having trouble with Exercise 4 in Chapter 7 of railstutorial.org . Here are
I'm following the ruby on rails tutorial: http://railstutorial.org/chapters/static-pages#top I'm up to using rspec. Having
In Chapter 9 of the Little Schemer, the Author presents the following two functions
In the railstutorial, why does the author choose to use this (Listing 10.25): http://ruby.railstutorial.org/chapters/updating-showing-and-deleting-users
Following Hartl's Railstutorial on Chapter 10 where we protect user edit pages so that
I have been following this tutorial, http://ruby.railstutorial.org/chapters/modeling-users?version=3.2#top , which I find great, but it
I have been following this tutorial, http://ruby.railstutorial.org/chapters/modeling-users?version=3.2#top , and I tried this in the

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.