before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:top, :index, :show, :stories, :by_author]
+ before_filter :authenticate_reader, :only => [:index, :show, :by_author, :count, :count_by_author]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
end
end
def index
- @action = self.class.controller.open(action_name, params, @operators)
- @action.cook params, operators
- public_list
- end
-
- def stories
- has_many_list
+ filer_list
end
def by_author
- filter_list
+ filer_list
end
def show
end
def count
- @comic = {:count => Comic.visible_count}
- respond_to do |format|
- format.json { render json: @comic.to_json }
- end
+ list_count
+ end
+
+ def count_by_author
+ list_count
end
def new
- @comic = Comic.new
- @comic.supply_default
- respond_to do |format|
- format.html
- format.js
- format.json { render json: @comic.to_json(Comic.show_json_opt) }
- end
+ form_new
end
-
+
def edit
- @comic = Comic.edit(params[:id], @operators)
- respond_to do |format|
- format.html
- format.js
- end
+ form_edit
end
-
+
def create
@comic = Comic.new
@comic.supply_default