OSDN Git Service

fix editor
[pettanr/pettanr.git] / app / controllers / license_groups_controller.rb
index 5c2aedf..b6a2353 100644 (file)
@@ -1,5 +1,5 @@
 class LicenseGroupsController < ApplicationController
-  before_filter :authenticate_admin!, :only => []
+  before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
   
   def self.model
     LicenseGroup
@@ -28,4 +28,30 @@ class LicenseGroupsController < ApplicationController
     list_count
   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