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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:25:07+00:00 2026-06-01T23:25:07+00:00

In Rails, when you create a model using scaffold like the following: rails generate

  • 0

In Rails, when you create a model using scaffold like the following:

rails generate scaffold User name:string email:string

It will generate the: models, controllers, and views

The views for example, in the index.html.erb file there is table which lists all the Users registers. For each user there are links: Show, Edit, Destroy

in the index.html.erb these are represented by the following lines:

 <td><%= link_to 'Show', student %></td>
 <td><%= link_to 'Edit', edit_student_path(student) %></td>
 <td><%= link_to 'Destroy', student, :confirm => 'Are you sure?', :method => :delete %></td>

and there also is a New User link which is represented by:

<%= link_to 'New Student', new_student_path %>

However, if I create a model,view and controller manually without the scaffold, then these ‘paths’ won’t be generated.
By ‘paths’ I mean: new_student_path, edit_student_path(student), student

How do I generate these manually?

  • 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-01T23:25:08+00:00Added an answer on June 1, 2026 at 11:25 pm

    Edit your config/routes.rb.
    You can add e.g. this:

    resources :students
    

    You can see more this at http://guides.rubyonrails.org/routing.html

    You can type rake routes at the command line to see what routes are available before and after doing this.
    Basically you will get the following routes:

    HTTP VerbPath   action  used for 
    GET     /photos         index   display a list of all photos 
    GET     /photos/new     new     return an HTML form for creating a new photo 
    POST    /photos         create  create a new photo 
    GET     /photos/:id     show    display a specific photo 
    GET     /photos/:id/edit edit   return an HTML form for editing a photo 
    PUT     /photos/:id     update  update a specific photo 
    DELETE  /photos/:id     destroy delete a specific photo
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I was using Rails 2, I did script/generate scaffold User to create the
I'd like to run the rails generate script and create a model that belongs
I created a rails model by doing script/generate model Customer name:string address:string city:string state:string
I'd like to create a callback function in rails that executes after a model
I'm using this command: rails generate model DayOfMonth day:integer Rails generated the model DayOfMonth
Note: Using Rails 3.1 and current delayed_job gem. I have a User model that
I have 2 controllers that I created using scaffold generator of rails. I wanted
I have a very simple rails 3 program with 2 models: a user model
What's the best way to create a model in Ruby on Rails that doesn't
I have created model, controller and view with rails scaffold generator: rails g scaffold

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.