title: Rails: Toggle a Boolean State with a link_to
body: <p>Added an admin view to my rails app (this: <a href="http://www.interque.co/" rel="nofollow">http://www.interque.co/</a>). Added a boolean state for approved to each question. I'm trying to toggle that state by clicking a link I've labeled approved.</p>
  
  <p>Here is my controller: </p>
  
  <pre><code>class AdminController &lt; ApplicationController
    def index
      @questions = Question.all
      unless current_user &amp;&amp; current_user.administrator?
          redirect_to root_path
      end
    end
  end
  </code></pre>
  
  <p>Here's the admin view I'm working with, which lists all unapproved questions:</p>
  
  <pre><code>&lt;% if current_user %&gt;
    &lt;% @questions.each do |question| %&gt;
      &lt;% if question.approved == false %&gt;
      &lt;div&gt;
          Title: &lt;%= question.title %&gt;&lt;br&gt;
          Description: &lt;%= question.description %&gt;&lt;br&gt;
          &lt;%= link_to "Approve", question_path(question), :method =&gt; :put %&gt;
      &lt;/div&gt;
      &lt;br&gt;
      &lt;% end %&gt;
    &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Can I toggle the state by clicking a link_to? I just need to set question.approved = true. </p>
  
  <p>Any help would be appreciated. Thanks in advance.</p>