开发者

Destroy and Show have same url in RoR, is it good?

I开发者_开发百科s it good when url to show and destroy are same? How it can be changed in RoR if i want continue use standard tools like script/generate scaffold ?

Thanks.


If you are following the REST convention Rails recommends, the url of a resource (noun) would be /resource_name/id for view, delete, update, and the difference will be the HTTP method (verb) you issue to the server: GET, POST, PUT, and DELETE.


Yes, this is good. Rails use the URL as well as the HTTP verb (GET, POST, PUT, DELETE) to determine which action a request should resolve to. script/generate scaffold has this behaviour, so you can continue to use it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜