Dynamic Routing

Capsule Coding
2 min readOct 7, 2020

--

TEST: Route to a view.. has an index page

CODE:resources

SPEC FILE:

describe 'Route to view' do
it 'has an index page' do
visit "/students"

get “students/:id”, to: “students#show”

* Use a routes variable in params within the logic of an action

* Assign an instance variable in a controller action

* Use a controller instance variable to generate a dynamic ERB template.

* Build a classical show action/view

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