title: Rails link_to update attribute from controller action
body: <p>I want to be able to have a link that when pressed updates one attribute based up a controller action. How would I be able to do this? Do I have to create a separate update route? I am new at this so please bear with me. </p>
  
  <p>controller</p>
  
  <pre><code>def completed
   @meeting = Meeting.find(params[:id])
   if @meeting.day_of_meeting == @meeting.days
    @meeting.update_attribute(:day_of_meeting, '1')
    redirect_to :back
   else
    @meeting.increment!
    redirect_to :back
   end
  end
  </code></pre>
  
  <p>model</p>
  
  <pre><code>def increment!
    update_attribute(:day_of_meeting, day_of_meeting + 1)
  end
  </code></pre>
  
  <p>view</p>
  
  <pre><code>&lt;%= link_to meetings_completed_path(@meeting), remote: true do %&gt;
  </code></pre>
  
  <p>routes</p>
  
  <pre><code>resources :meetings do
    get 'meetings/completed'
  end
  </code></pre>