- @comic_story = ComicStory.edit(params[:id], @operators)
- @comic = Comic.edit(@comic_story.comic_id, @operators) if @comic_story.comic_id
- respond_to do |format|
- if @comic_story.destroy_and_shorten
- flash[:notice] = I18n.t('flash.notice.destroyed', :model => ComicStory.model_name.human)
- format.html { redirect_to play_comic_path(@comic) }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => ComicStory.model_name.human)
- format.html { redirect_to comic_story_path(@comic_story) }
- format.json { render json: @comic_story.errors, status: :unprocessable_entity }
- end
- end
+ 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 play_comic_path(@binder)