diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 991af015..b54d98b8 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -129,6 +129,7 @@ class ForumsController < ApplicationController format.html { redirect_to @forum, notice: l(:label_forum_create_succ) } format.json { render json: @forum, status: :created, location: @forum } else + flash.now[:error] = "#{l :label_forum_create_fail}: #{@forum.errors.full_messages[0]}" format.html { render action: "new" } format.json { render json: @forum.errors, status: :unprocessable_entity } end diff --git a/app/views/forums/_form.html.erb b/app/views/forums/_form.html.erb index b14df7b1..f67aa118 100644 --- a/app/views/forums/_form.html.erb +++ b/app/views/forums/_form.html.erb @@ -3,15 +3,15 @@