title: Rails RESTful controller and rendering after custom action
body: <p>How can I render after executing an action in a restful controller instead of redirecting.</p>
  
  <p>I have a controller with standard actions, and I added a special action that adds data to the resource in question, via a form on the #show page (Think comments on a post). I am validating the input from the form and want to re-render the show action on error and redirect to the show action on success.</p>
  
  <p>I want to render to save the user from inputting their info twice, but when I try to render the show action with an error in the flash[:notice] I get an error saying that I am not specifying an ID. When I do specify an ID, it tries to render a new template that doesn't exist yet.</p>
  
  <p>I am thinking that it should be a as simple as:</p>
  
  <pre><code>def add_comment
    if my_validation?
      save the object
      redirect_to :action =&gt; "show", :id =&gt; params[:id]
    else
      render :action =&gt; "show", :id =&gt; params[:id]
    end
  end
  </code></pre>
  
  <p>This is not my actual code, just something I put together just now as an example.</p>