I created a simple rails app and implemented devise on it, I added the login/register feature and it works fine. But when I add the "log out" feature, it gives me a Routing Error
that No route matches [GET] "/ideas/sign_out"
Here is what I implemented:
<% unless idea_signed_in? %>
<li><a href="#">Explore</a></li>
<li><%= link_to "Sign in", new_idea_session_path %></li>
<li><%= link_to "Share an idea", new_idea_registration_path %></li>
<% else %>
<li><a href="#">Dashboard</a></li>
<li><a href="#">Explore</a></li>
<li><%= link_to "Sign Out", destroy_idea_session_path, method: :delete %></li>
<% end %>
Even tried it with :method => :delete
but still nothing. I ran rake
routes and my routes are valid:
destroy_idea_session_path DELETE /ideas/sign_out(.:format) devise/sessions#destroy
I added <%= javascript_include_tag :defaults %>
to my application.html.erb but still no luck.
My routes.rb
Rails.application.routes.draw do
devise_for :ideas
root 'welcome#index'
end