title: Rails use not condition with before_filter
body: <p>I'm using before_filter in my application. I have a method <code>logged_in?</code> which returns true if the user is logged in.</p>
  
  <pre><code>def logged_in?
    !!current_user
  end
  
  def current_user
    @current_user = (User.find(session[:user_id]) if session[:user_id]) || false
  end
  </code></pre>
  
  <p>Now in my users controller I want an action to execute only if a user is not logged in. For this I want to use the <strong>not</strong> condition with <code>logged_in?</code> method in <code>before_filter</code> as:</p>
  
  <pre><code>before_filter :!(logged_in?)
  </code></pre>
  
  <p>But this gives me an error. I'm resisting creating a new method for not logged in.</p>
  
  <p>Please help me figure out the correct syntax to accomplish this. </p>