class SystemPicturesController < ApplicationController
- before_filter :authenticate_admin!, :except => [:index, :show]
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse, :create, :update, :destroy]
private
end
end
- # GET /system_pictures/new
- # GET /system_pictures/new.json
- def new
- @system_picture = SystemPicture.new
+ def list
+ @system_pictures = SystemPicture.all
respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @system_picture }
+ format.html { render layout: 'system' }
+ format.json { render json: @system_pictures }
end
end
- # GET /system_pictures/1/edit
- def edit
+ def browse
@system_picture = SystemPicture.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @system_picture}
+ end
end
+
# POST /system_pictures
# POST /system_pictures.json
def create