title: Rails Controller - format.png
body: <p>Trying to get a controller block in rails to work.  When responding to a url I want to show the .png file associated with the model.</p>
  
  <pre><code>respond_to do |format|
  format.html  { render :blank }
  format.json { render json: @play }
  format.png  do  
  send_data data, :type =&gt; "image/png", :filename =&gt; 'screenshot.png'
  end
  </code></pre>
  
  <p>Data is working fine and is a 200Kb file.  The issue is when I go to the url:</p>
  
  <pre><code>http://localhost:8080/plays/testing1.png
  </code></pre>
  
  <p>it brings me to a blank page (I created show.png.erb and have nothing in there).  Not sure how to get the png file to either be shown inline or downloadable.</p>
  
  <p>Thanks for any help</p>