before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
end
- before_filter :authenticate_admin!, :only => [:list, :browse]
def self.model
Comic
end
end
- def list
- @comics = Comic.all
-
- respond_to do |format|
- format.html { render layout: 'system' }# index.html.erb
- format.json { render json: @comics }
- end
- end
-
- def browse
- @comic = Comic.find(params[:id])
-
- respond_to do |format|
- format.html { render layout: 'system' } # show.html.erb
- format.json { render json: @comic }
- end
- end
-
def new
@comic = Comic.new
@comic.supply_default
respond_to do |format|
- format.html # new.html.erb
+ format.html
format.js
format.json { render json: @comic.to_json(Comic.show_json_opt) }
end
end
def edit
- @comic = Comic.edit(params[:id], @author)
+ @comic = Comic.edit(params[:id], @operators)
respond_to do |format|
format.html
format.js
end
def destroy
- @comic = Comic.edit(params[:id], @author)
+ @comic = Comic.edit(params[:id], @operators)
respond_to do |format|
if @comic.destroy_with_story
flash[:notice] = I18n.t('flash.notice.destroyed', :model => Comic.model_name.human)