Send querystring params as part of form post

前端 未结 4 1247
旧巷少年郎
旧巷少年郎 2021-02-08 17:25

Is there a way to capture the querystring and send that along as part of a form post? I\'m using Rails 2.3.5 and my user is on a page that has multiple querystring parameters. O

4条回答
  •  我在风中等你
    2021-02-08 17:58

    The preferred way would be to use hidden fields. I haven't tried it, but I think you can specify additional query string parameters within the *_path or *_url helpers. Something like:

    <% form_for(@post,
               :url => post_path(@post, :foo => 'foo', :bar => 'bar')) do |f| %>
      ...
    <% end %>
    

提交回复
热议问题