- @story_sheet = StorySheet.edit(params[:id], @author)
- ot = @story_sheet.t
- @story_sheet.attributes = params[:story_sheet]
- @story_sheet.overwrite @author
- @story = Story.edit(@story_sheet.story_id, @author) if @story_sheet.story_id
- respond_to do |format|
- if @story_sheet.store ot
- flash[:notice] = I18n.t('flash.notice.updated', :model => StorySheet.model_name.human)
- format.html { redirect_to play_story_path(@story) }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_updated', :model => StorySheet.model_name.human)
- format.html { render action: "edit" }
- format.json { render json: @story_sheet.errors, status: :unprocessable_entity }
- end
- end
+ @my_model_class = self.class.model
+ @item = @my_model_class.edit(params[:id], @operators)
+ ot = @item.t
+ @item.attributes = params[@item.item_name]
+ @item.overwrite @operators
+ @binder = @my_model_class.binder_model.edit(@item.binder_id, @operators) if @item.binder_id
+ # no check permission for destination
+ # swapable hidden panel
+ #@panel = @my_model_class.destination_model.show(@item.destination_id, @operators) if @item.destination_id
+
+ leaf_render_update ot, play_scroll_path(@binder)