OSDN Git Service

fix: server
[pettanr/pettanr.git] / app / controllers / story_sheets_controller.rb
index 887f4e8..262b5da 100644 (file)
@@ -43,7 +43,7 @@ class StorySheetsController < ApplicationController
   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]
@@ -55,7 +55,7 @@ class StorySheetsController < ApplicationController
   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]
@@ -72,7 +72,7 @@ class StorySheetsController < ApplicationController
     set_model
     @item = @my_model_class.edit(params[:id], @operators)
     @binder = @my_model_class.binder_model.edit(@item.binder_id, @operators) if @item.binder_id
-    render_destroy '/home/' + play_story_path(@item)
+    render_destroy play_story_path(@binder)
   end
   
 end