![](/style/images/good.png)
7
![](/style/images/bad.png)
button_to: Support `authenticity_token:` option by seanpdoyle · Pull Request #43...
source link: https://github.com/rails/rails/pull/43417
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Match support for passing authenticity_token:
in form_with
andform_for
calls.
button_to "Create", Post.new, authenticity_token: false # => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button></form> button_to "Create", Post.new, authenticity_token: true # => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button><input type="hidden" name="form_token" value="abc123..." autocomplete="off" /></form> button_to "Create", Post.new, authenticity_token: "secret" # => <form class="button_to" method="post" action="/posts"><button type="submit">Create</button><input type="hidden" name="form_token" value="secret" autocomplete="off" /></form>
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK