如何避免丢弃我不想要GET表单的URL

时间:2017-02-16 10:18:45

标签: ruby-on-rails ruby ruby-on-rails-5

我有一个表单标记:

= form_tag entities_path, method: :get do
  = select(....)
  = select(....)
  = button_to "Search", name: nil

当我点击一个按钮时,它会将许多我不想要的东西放入网址,例如authenticity_token和utf-8。我怎么能避免这种情况?我只想在网址中选择2个值及其值。

1 个答案:

答案 0 :(得分:0)

这些属性can be disabled

= form_tag entities_path, method: :get, authenticity_token: false, enforce_utf8: false do
  = select(....)
  = select(....)
  = button_to "Search", name: nil