title: How do you protect controller actions with Devise?
body: <p>I'm using Devise and a user can either be an admin or not (true, false). </p>
  
  <p>Can someone help me figure out how to protect a controller action such as:</p>
  
  <pre><code>  def new
      @post = Post.new
    end
  </code></pre>
  
  <p>I know Devise lets you call administrators by using in views but can this be used in controllers?: </p>
  
  <pre><code>if current_user.admin?
  </code></pre>
  
  <p>Thanks in advance.</p>