I am using gem 'twitter-bootstrap-rails' for rails bootstrap
I have a few links on a page Rails code
<td><%= link_to 'Destroy', swimming_classschedule, method: :delete, data: { confirm: 'Are you sure?' } %></td>
<li> <%= link_to "Logout", destroy_user_session_path, method: :delete, :class => 'navbar-link' %> </li>
html code:
<a href="/users/sign_out" class="navbar-link" data-method="delete" rel="nofollow">Logout</a>
<td><a href="/swimming/students/1" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Destroy</a></td>
<td><a href="/swimming/students/3" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Destroy</a></td>
Whenever I click to delete a student I got logged out. I am totally confused
I had the same problem.. I read in the forums that it was due to javascript issues.
In application.js, I previously removed the original files because I thought they weren't needed as I was using bootstrap.js. I put it back in the file and now the delete method works again!
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap
//= require_tree .
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