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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:06:42+00:00 2026-06-14T08:06:42+00:00

If I generate a scaffold called product , what are the differences between the

  • 0

If I generate a scaffold called "product", what are the differences between the following when I use them in coding my app? @products, @product, @Product, @Products, Products, Product, product, and products (I’m pretty sure those aren’t all used, but it should at least give the idea of what I’m referring to).

I can’t seem to find a simple explanation of what each combination of @/capitalization/plurality means. Help would be greatly appreciated.

  • 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-14T08:06:44+00:00Added an answer on June 14, 2026 at 8:06 am

    The only reserved word is capitalized Product and this references the object model. For example to get all products and save it in the variable @products you would do:

    @products = Product.all
    @product = Product.find(1)
    

    If you left off the @ sign off of ‘products’ then it would be saved only as a local variable and your view would not be able to access it.

    In this example @products and @product are variables you declare in the controller. You could just use:

    @lotsofproducts = Product.all
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question to the following procedure: script/generate scaffold product title:string description:text db:migrate
I have a controller called 'exposures' which I created automatically with the script/generate scaffold
I ran the following commands: rails generate scaffold order name:string address:text email:string pay_type:string rails
I used nifty_scaffold to generate scaffold for a new model called Fax In routes.rb,
I am new to rails. When I generate scaffold for users , in products/index.html
I'm following this tutorial (seems good) for Rails. After I run ruby script/generate scaffold
I use scaffold to create my first MVC in Rails 3.1 rails generate scaffold
The command rails generate scaffold Post name:string title:string content:text generated the following 20101109001203_create_posts.rb file:
Each time I do a rails generate scaffold Name , the app/assets/stylesheets/scaffolds.css.scss file is
In Rails, when you create a model using scaffold like the following: rails generate

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.