Rails Routing (root :to => ...)

Viewed 81384

I know how to set the routes root of my rails app to a controller and an action.

But how to add an id?

/pages/show/1 should be the root.

How do I set this?

6 Answers

Use Rails 5.1 Add this to the config/routes.rb

root 'pages#show', {id: 1}
Related