1
點擊按鈕,在URL通過button=
:在Rails中禁用提交按鈕的URL參數?
# example.html.haml
= form_for @contact, html: { method: :get }
= f.text_field :phone
= f.button "Call Me!"
如何防止滑軌沿着額外的URL參數傳遞?
點擊按鈕,在URL通過button=
:在Rails中禁用提交按鈕的URL參數?
# example.html.haml
= form_for @contact, html: { method: :get }
= f.text_field :phone
= f.button "Call Me!"
如何防止滑軌沿着額外的URL參數傳遞?
添加name: nil
到按鈕:
= form_for @contact, html: { method: :get }
= f.text_field :phone
= f.button "Call Me!", name: nil