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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:59:51+00:00 2026-06-17T10:59:51+00:00

I am following a tutorial and got to this point: http://rubysource.com/building-your-first-rails-application-views-and-controllers/ rails generate controller

  • 0

I am following a tutorial and got to this point: http://rubysource.com/building-your-first-rails-application-views-and-controllers/

rails generate controller urls new

The reason we only passed in the new action (instead of new, create,
and show) is because Rails automatically generates a dummy view for
each action included in the generator call. In this case, we only want
a dummy view for the new action, so we exclude the others.

So why we only need to create the controller for new? Can someone plase explain it in a little more details?

  • 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-17T10:59:52+00:00Added an answer on June 17, 2026 at 10:59 am

    The command is used to create the UrlsController with only one method: new.

    This command will also automatically create a view file for you in:

    app/views/urls/new.html.erb
    

    Had you supplied more arguments like:

    rails generate controller urls new create show
    

    You would have gotten:

    app/views/urls/new.html.erb
    app/views/urls/create.html.erb
    app/views/urls/show.html.erb
    

    Since the tutorial only needs the new view it was unnecessary to create the additional views, hence those additional arguments were not added to the generate command.

    Later in the tutorial you manually add the create and show methods, but you never add views for those methods (since those methods will not be needing specific views files in this application).

    So: what you did was create the controller UrlsController with one method new, and the corresponding view for that method. The rest of the methods you will code in manually later in the tutorial so there was no need to auto-generate anything else (create or show).

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

Sidebar

Related Questions

I was following this tutorial http://nepomucenobr.com.br/blog/post/Generating-e2809cdummy-datae2809d-with-Visual-Studio.aspx and I got to the point where I
I'm using the following tutorial http://developer.android.com/resources/tutorials/views/hello-mapview.html in order to create a map view and
I am following this tutorial: http://www.csharp-station.com/Tutorials/Lesson01.aspx I pasted this into a text file, named
I am following this tutorial to set up a push notifications >> http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12 Yet
I am just starting to learn OpenGL today from this tutorial: http://openglbook.com/the-book/ I got
I'm currently trying to implement searching by following this tutorial. http://www.appcoda.com/how-to-add-search-bar-uitableview/ However, I'm at
I've been following this tutorial , and I've got to the point where we
I am following the Microsoft tutorial for creating my first sharepoint 2013 app. (http://msdn.microsoft.com/en-us/library/fp142379.aspx
I am following the following tutorial ( http://www.highoncoding.com/Articles/642_Creating_a_Stock_Widget_in_ASP_NET_MVC_Application.aspx ) on using ajax to render
I am doing the following tutorial http://msdn.microsoft.com/en-us/library/ms731835%28v=vs.100%29.aspx and the program is working perfectly fine.

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.