title: Safe redirect to nested resource in Rails
body: <p>I recently added the Brakeman gem to my Gemfile and had to see, that I should use </p>
  
  <pre><code>:only_path =&gt; true
  </code></pre>
  
  <p>to make it more secure. But i'm using a nested resource and don't know exactly how, here is the part from my Controller.</p>
  
  <pre><code>if @comment.update_attributes(params[:comment])
    redirect_to [@message, @comment], notice: 'Comment was successfully updated.'   
  </code></pre>
  
  <p>How can i do this, i only saw the only_path attribute with the url_for helper.
  Thanks for your Help!</p>