before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
before_filter :authenticate_reader, :only => [
- :index, :show, :by_panel, :by_scroll, :by_author, :count, :count_by_panel, :count_by_scroll, :count_by_author
+ :index, :show, :by_panel, :by_scroll, :by_author
]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
end
-
- def self.model
- ScrollPanel
- end
def index
filer_list
end
end
- def count
- list_count
- end
-
- def count_by_panel
- list_count
- end
-
- def count_by_scroll
- list_count
- end
-
- def count_by_author
- list_count
- end
-
def new
form_new
end
end
def create
- @my_model_class = self.class.model
+ set_model
@item = @my_model_class.new
@item.supply_default
@item.attributes = params[@item.item_name]
end
def update
- @my_model_class = self.class.model
+ set_model
@item = @my_model_class.edit(params[:id], @operators)
ot = @item.t
@item.attributes = params[@item.item_name]