Rails Routing (root :to => …)

后端 未结 6 1630
北恋
北恋 2021-01-31 02:03

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

6条回答
  •  感情败类
    2021-01-31 02:39

    Had this same problem and this worked for me:

    root :to => "pages#show", :id => '1'
    

提交回复
热议问题