class PicturesController < ApplicationController
layout 'test' if Pettanr::Application.test_layout
- before_filter :authenticate_user!, :only => [:show, :credit]
+ before_filter :authenticate_user!, :only => [:show, :credit, :md5]
+ before_filter :authenticate_artist, :only => [:md5]
def show
@picture = Picture.show(params[:id], @author)
end
end
+ def md5
+ @pictures = Picture.list_by_md5(params[:md5])
+
+ respond_to do |format|
+ format.html
+ format.json { render json: @pictures.to_json }
+ end
+ end
+
end