class LicensesController < ApplicationController
before_filter :authenticate_resource_reader, :only => [
- :by_license_group, :by_system_picture, :count_by_license_group, :count_by_system_picture
+ :by_license_group, :by_system_picture
]
before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
-
- def self.model
- License
- end
def index
filer_list
end
end
- def count
- list_count
+ def new
+ form_new
end
- def count_by_license_group
- list_count
+ def edit
+ form_edit
end
- def count_by_system_picture
- list_count
+ def create
+ set_model
+ @item = @my_model_class.new
+ @item.supply_default
+ @my_model_class.fold_extend_settings params[@my_model_class.item_name]
+ @item.attributes = params[@my_model_class.item_name]
+ @item.overwrite
+ render_create
end
- def new
- form_new
+ def update
+ set_edit
+ @my_model_class.fold_extend_settings params[@my_model_class.item_name]
+ @item.attributes = params[@my_model_class.item_name]
+ @item.overwrite
+ render_update
end
- def edit
- form_edit
+ def destroy
+ set_model
+ @item = @my_model_class.edit(params[:id], @operators)
+ render_destroy '/' + @my_model_class.path_name
end
end