OSDN Git Service

classname rename to module_name
[pettanr/pettanr.git] / app / controllers / licenses_controller.rb
index 8456d6e..dc31794 100644 (file)
@@ -64,4 +64,30 @@ class LicensesController < ApplicationController
     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
+  
+  def destroy
+    @item = self.class.model.edit(params[:id], @operators)
+    respond_to do |format|
+        flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => self.class.model.model_name.human)
+        format.html { redirect_to @item }
+        format.json { render json: @item.errors, status: :unprocessable_entity }
+    end
+  end
 end