1 class PicturesController < ApplicationController
2 layout 'test' if Pettanr::TestLayout
3 before_filter :authenticate_user!, :only => [:show, :credit]
6 @picture = Picture.show(params[:id])
9 opt = {:type => @picture.mime_type, :disposition=>"inline"}
10 format.png { send_data(@picture.restore(params[:subdir]), opt ) }
11 format.gif { send_data(@picture.restore(params[:subdir]), opt ) }
12 format.jpeg { send_data(@picture.restore(params[:subdir]), opt ) }
14 format.json { render :json => @picture.to_json}
19 @picture = Picture.show(params[:id])
21 respond_to do |format|
22 format.html { render :layout => false } # show.html.erb
23 format.json { render :json => @picture.to_json}