提交 cf75417f 编写于 作者: V Vijay Dev

document the shortcut to the root route helper [ci skip]

This was implemented in 2ee4dd85
上级 64d8d244
## Rails 4.0.0 (unreleased) ##
* Allows the route helper `root` to take a string argument. For example, `root 'pages#main'`. *bcardarella*
* Forms of persisted records use always PATCH (via the `_method` hack). *fxn*
* For resources, both PATCH and PUT are routed to the `update` action. *fxn*
......
......@@ -622,6 +622,7 @@ You can specify what Rails should route +"/"+ to with the +root+ method:
<ruby>
root :to => 'pages#main'
root 'pages#main' # shortcut for the above
</ruby>
You should put the +root+ route at the top of the file, because it is the most popular route and should be matched first. You also need to delete the +public/index.html+ file for the root route to take effect.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册