开发者

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

开发者 https://www.devze.com 2022-12-28 17:09 出处:网络
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 ?

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

精彩评论

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

关注公众号