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? %> -
-

<%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:

- -
- <% end %>

<%= f.text_field :subject, :required => true, :size => 95 %>

<%= f.text_area :content, :required => true, :id => 'editor01' %>

@@ -20,6 +10,6 @@ <%= l(:label_attachment_plural) %>
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>

- <%= f.submit :value => l(:label_memo_create) %> + <%= f.submit :value => l(:label_memo_create) %> <%= link_to l(:button_back), forum_path(@forum) %>
<% end %> \ No newline at end of file diff --git a/app/views/memos/new.html.erb b/app/views/memos/new.html.erb index bcda7896d..03a60044a 100644 --- a/app/views/memos/new.html.erb +++ b/app/views/memos/new.html.erb @@ -27,5 +27,5 @@ <%= render :partial => 'memos/topic_form' %> -<%= link_to l(:button_back), forum_path(@forum) %> +