How can I check if user is signed in with rails devise?
First of all remove do
from this line, you don't need that
<% if user_signed_in? %>
Secondly add :
after method
, it's a key value pair
<%= link_to "Log out", destroy_user_session_path, method: :delete %>
Hope that helps!
You are making a syntax error in method delete. Copy the below code
<% if user_signed_in? %>
<%= link_to "Log out", destroy_user_session_path, :method=>'delete'%>
<% else %>
<%= link_to "login", new_user_session_path %>
<% end %>