When a user clicks 'logout', my app is running destroy_user_session_path and it works great. However, I need to run the destroy method from my carts_controller before destroy_user_session_path takes place. What is the best way to run these two actions when the logout button is clicked? (I can't find the devise controller or sessionscontroller in the application)
application.html.erb - Destroy call for logout button
<%= link_to "Logout", destroy_user_session_path, method: :delete, :class => 'navbar-link boldLinks btn btn-primary' %>
carts/show.html.erb - Remove/empty cart call needed for before destroy when one button is clicked
<%= link_to 'Empty Cart', @cart, method: :delete, data: {confirm: 'Are you sure you want to empty your cart?'}, :class => 'btn btn-danger whiteText' %>