diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 35f8ee97b..a47d8ee09 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -245,15 +245,14 @@ class ForumsController < ApplicationController # PUT /forums/1.json def update @forum = Forum.find(params[:id]) - respond_to do |format| if @forum.update_attributes(params[:forum]) - format.js {render :text=> true} + format.js format.html { redirect_to @forum, notice: l(:label_forum_update_succ) } format.json { head :no_content } else flash.now[:error] = "#{l :label_forum_update_fail}: #{@forum.errors.full_messages[0]}" - format.js { render :text=> false} + format.js format.html { render action: "edit" } format.json { render json: @forum.errors, status: :unprocessable_entity } end diff --git a/app/views/forums/_edit.html.erb b/app/views/forums/_edit.html.erb index 5e8db19a5..e19068ef1 100644 --- a/app/views/forums/_edit.html.erb +++ b/app/views/forums/_edit.html.erb @@ -5,12 +5,9 @@