- @story = Story.edit(params[:id], @author)
- ot = @story.t
- @story.attributes = params[:story]
- @story.overwrite
- respond_to do |format|
- if @story.store @author, ot
- flash[:notice] = I18n.t('flash.notice.updated', :model => Story.model_name.human)
- format.html { redirect_to play_story_path(@story, :page => @story.t.to_i + 1) }
- format.json { head :ok }
- else
- flash[:notice] = I18n.t('flash.notice.not_updated', :model => Story.model_name.human)
- format.html { render action: "edit" }
- format.json { render json: @story.errors, status: :unprocessable_entity }
- end
- end