Rails MVC learning journal.

Capsule Coding
2 min readSep 23, 2020

--

- Create a controller for students and have it inherit from ApplicationController

- Create a route for the path `/students` that maps to a StudentsController `index` action.

- Add a controller action to the StudentsController named `index`

- Have the new `index` action pull in a list of all of the students with `Student.all` and store it in an instance variable

- Create an `index.html.erb` view file and render it from your `Students#index` action. The `index.html.erb` file should be placed within a `views/students` folder.

- In your view, iterate over the list of students returned from the index action in the controller and display the appropriate information.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Capsule Coding
Capsule Coding

No responses yet

Write a response