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 ) }
13 format.json { render :json => @picture.to_json}
18 @picture = Picture.show(params[:id])
20 respond_to do |format|
21 format.html { render :layout => false } # show.html.erb
22 format.json { render :json => @picture.to_json}