title: Rails 4: setup custom redirect_to in link_to helper with remote: true
body: <p>In my Rails 4 app, I have a <code>calendar</code> and a <code>post</code> models: a <code>calendar</code> <code>has_many</code> <code>post</code>s and a <code>post</code> <code>belong_to</code> a <code>calendar</code>.</p>
  
  <p>In <code>Calendars#Show</code>, I display all the <code>post</code>s that belong to this <code>calendar</code>.</p>
  
  <p>In this very same view, I use the following link to <code>update</code> the <code>approval</code> custom attribute of a <code>post</code>:</p>
  
  <pre><code>&lt;%= link_to post_path(:id =&gt; @post.id, "post[approval]" =&gt; "ok"), :method =&gt; :patch %&gt;
  </code></pre>
  
  <p>Problem, once I click this link, I am taken to the <code>Posts#Show</code> view of this post.</p>
  
  <p>What I would like instead, is to remain on the same <code>Calendars#Show</code> view.</p>
  
  <p>I thought of implementing a <code>redirect_to :back</code> in my <code>Posts#Update</code> action in the controller, but this is not possible, since this would redirect me to the <code>Posts#Edit</code> view when I update a post from this very same <code>Posts#Edit</code> view.</p>
  
  <p>So, I am looking for a solution to implement a redirect_to specifically for my <code>link_to</code> helper with <code>remote: true</code> from the <code>Calendars#Show</code> to the <code>Calendars#Show</code>.</p>
  
  <p>Is that possible?</p>