title: How can I check if user is signed in with rails devise?
body: <p>I am trying to add the header to my rails application based on authenticating the user. So here I am checking that if the user has logged in or signed in and then adding login/logout link based on that.</p>
  
  <p>But I am getting the following error:</p>
  
  <pre><code>application.html.erb:16: syntax error, unexpected tSYMBEG, expecting keyword_do or '{' or '(' ...roy_user_session_path, method :delete );@output_buffer.safe_
  </code></pre>
  
  <p>Here's what I have tried:</p>
  
  <pre><code>&lt;% if user_signed_in? do %&gt; 
      &lt;%= link_to "Log out", destroy_user_session_path, method :delete %&gt;
  &lt;% else %&gt;
      &lt;%= link_to "login", new_user_session_path %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>How can I resolve this?</p>