diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index aad575ee5..9f261c78a 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -89,10 +89,9 @@ class MemosController < ApplicationController offset(@reply_pages.offset). all if @memo.new_record? - format.html { redirect_to back_url, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" } + format.html { render :new,:layout=>'base'} else - format.html { render action: :show }#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" } - # format.html { redirect_to back_memo_or_forum_url}#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" } + format.html { render action: :show } format.json { render json: @memo.errors, status: :unprocessable_entity } end diff --git a/app/views/memos/_topic_form.html.erb b/app/views/memos/_topic_form.html.erb index 3f5642733..d7d0aeca0 100644 --- a/app/views/memos/_topic_form.html.erb +++ b/app/views/memos/_topic_form.html.erb @@ -1,15 +1,5 @@ <%= labelled_form_for(@memo, :url => forum_memos_path) do |f| %> - <% if @memo.errors.any? %> -
<%= f.text_field :subject, :required => true, :size => 95 %>
<%= f.text_area :content, :required => true, :id => 'editor01' %>
@@ -20,6 +10,6 @@ <%= l(:label_attachment_plural) %>