开发者

Using 'resource' route in rails 3.1.0.rc4 (Newbie)

I understood how simple route, default route and root routes are used. But I didn't get a hair of what resource routes do and how it works. A lot of examples out there assume that one has worked with rails 2 before. So here is my situation:

I created a controller + view开发者_运维问答 like this: $ rails g controller main view1 view2 view3 ... viewN

Now I set root :to => "main#view1" and others are by default given routes like GET "/main/view2" etc. Can I use the concept of "resources" in here? If not then where is it used?


resources are used for basic CRUD routes as described here.

Other routes need to be explicitly written (but you'd better nest them in a namespace).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜