Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form_with(url: url, remote: false, authenticity_token:true) won't generate tokens #28796

Closed
krtschmr opened this issue Apr 19, 2017 · 2 comments

Comments

@krtschmr
Copy link

krtschmr commented Apr 19, 2017

=form_with url: "/", remote: false, authenticity_token: true do |f|
  =f.submit "Boom"

Expected behavior

according #26976 (review) and also the comments i expect that there will be a token, because it's not remote AND authenticity_token is set to true.

Actual behavior

<form action="/" accept-charset="UTF-8" data-remote="true" method="post">
    <input name="utf8" type="hidden" value="✓">
    <input type="submit" name="commit" value="Boom!" class="btn btn-primary" />
</form>

remote is set to :true and no tokens included

System configuration

5.1.rc1

Ruby version:
2.3

@pixeltrix
Copy link
Contributor

@krtschmr if you check the documentation for form_with options you'll see there's a new option called :local - set that to true and it will add the token. There's no need to add authenticity_token: true.

@krtschmr
Copy link
Author

thank you @pixeltrix i was just reading code ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants