简体   繁体   中英

Does link_to always use GET and button_to always POST?

似乎,如果未指定:method,则link_to始终是GET,而button_to总是POST。

Per the specs , yes, you are correct. link_to just generates an <a> tag, so that's definitely just a GET . If you don't specify otherwise, button_to does generate a POST .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM