I just upgraded the gem less-rails-bootstrap to use twitter bootstrap 2.1.0, and it seems to have broken this code in my view, inside a bootstrap dropdown:
<%= link_to 'Logout', destroy_admin_user_session_path, :method => :delete %>
The server seems to think this is a GET request instead of a DELETE. However, if I take that view code and put it immediately outside the dropdown, then it works great and the server recognizes the DELETE request.
If I change my gemfile as such:
gem 'less-rails-bootstrap', '~> 2.0.4'
Then run 'bundle update' and restart the server, then everything works as expected again. But if I simply have:
gem 'less-rails-bootstrap'
Then run 'bundle update' and restart the server, then the server thinks the DELETE is a GET request.
I tried switching to the gem 'twitter-bootstrap-rails', and the exact same issue occurs. I assume I must be doing something wrong?
Yeah, it's a Twitter Bootstrap issue. Probably will be fixed in the next release. Here, try this quick fix:
$('body')
.off('click.dropdown touchstart.dropdown.data-api', '.dropdown')
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() });
Apparently others are having the same issue as well: https://github.com/twitter/bootstrap/issues/4688
The quick fix with devise for now seems to be to change devise.rb to include:
config.sign_out_via = :get
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With