From 7eb1a767349b3565d44737265144eb1eba065e8d Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 25 Jul 2014 10:42:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91=E8=B4=B4?= =?UTF-8?q?=E5=90=A7=E6=97=A0=E5=AF=BC=E8=88=AA=E6=A0=8F=E3=80=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=A4=B1=E8=B4=A5=E6=97=A0=E6=8F=90=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 5 ++++- config/locales/zh.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 9c41f91d6..d3de11177 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -1,5 +1,7 @@ # added by fq class ForumsController < ApplicationController + layout "users_base" + # GET /forums # GET /forums.json before_filter :find_forum_if_available @@ -143,9 +145,10 @@ class ForumsController < ApplicationController respond_to do |format| if @forum.update_attributes(params[:forum]) - format.html { redirect_to @forum, notice: 'Forum was successfully updated.' } + 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.html { render action: "edit" } format.json { render json: @forum.errors, status: :unprocessable_entity } end diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 52cc04000..3b0c49029 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1918,6 +1918,8 @@ zh: label_memo_create_fail: 发布失败 label_forum_create_succ: 贴吧新建成功 label_forum_create_fail: 贴吧新建失败 + label_forum_update_succ: 贴吧更新成功 + label_forum_update_fail: 贴吧更新失败 label_first_page_create_fail: 首页定制失败 label_forum_edit: 编辑讨论区 label_memo_create: 发布