修改编辑贴吧无导航栏、提交失败无提示bug

This commit is contained in:
z9hang 2014-07-25 10:42:56 +08:00
parent 138d90a887
commit 7eb1a76734
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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: 发布