X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fcontrollers%2Flicense_groups_controller.rb;h=b6a235344e8f2712a333973eed5779667ecc997c;hb=b404a6f66817a05b366a452fdf5eda4f9ac9c50f;hp=7d3aa4b7b64abb952f85f1bbc55e6e031a71e528;hpb=f5ce28ab01c4aeac1a9be214af82f9d7002b670d;p=pettanr%2Fpettanr.git diff --git a/app/controllers/license_groups_controller.rb b/app/controllers/license_groups_controller.rb index 7d3aa4b7..b6a23534 100644 --- a/app/controllers/license_groups_controller.rb +++ b/app/controllers/license_groups_controller.rb @@ -1,41 +1,57 @@ class LicenseGroupsController < ApplicationController - layout 'test' if Pettanr::TestLayout - before_filter :authenticate_admin!, :only => [:list, :browse] + before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy] + + def self.model + LicenseGroup + end - # GET /license_groups - # GET /license_groups.json def index - @license_groups = LicenseGroup.list({}) - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @license_groups.to_json(LicenseGroup.list_json_opt) } - end + filer_list + end + + def show_html_format format + format.html { + @license_group = @item + } end - - # GET /license_groups/1 - # GET /license_groups/1.json + def show - @license_group = LicenseGroup.show(params[:id]) + set_show respond_to do |format| - format.html # show.html.erb - format.json { render json: @license_group.to_json(LicenseGroup.show_json_include_opt) } + show_html_format format + show_prof_format format + show_json_format format end end - - def list - @license_groups = LicenseGroup.all - - respond_to do |format| - format.html { render layout: 'system' } - end + + def count + list_count end - - def browse - @license_group = LicenseGroup.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - end + + def new + form_new + end + + def edit + form_edit end + + 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 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 + end