#1279 主页--“我要提问”/“我要反馈” 置所有条件为空,点击发布按钮,未给出类似于“主题/内容不能为空字符”的提示信息,给出错误信息后跳转错误,修正,将两个按钮并排
This commit is contained in:
parent
5d65901ebd
commit
64107ca5cc
|
@ -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
|
||||
|
||||
|
|
|
@ -1,15 +1,5 @@
|
|||
<%= labelled_form_for(@memo, :url => forum_memos_path) do |f| %>
|
||||
<% if @memo.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% @memo.errors.full_messages.each do |msg| %>
|
||||
<li><%= msg %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="actions" style="max-width:680px">
|
||||
<p><%= f.text_field :subject, :required => true, :size => 95 %></p>
|
||||
<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor01' %></p>
|
||||
|
@ -20,6 +10,6 @@
|
|||
<%= l(:label_attachment_plural) %><br />
|
||||
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
|
||||
</p>
|
||||
<%= f.submit :value => l(:label_memo_create) %>
|
||||
<%= f.submit :value => l(:label_memo_create) %> <%= link_to l(:button_back), forum_path(@forum) %>
|
||||
</div>
|
||||
<% end %>
|
|
@ -27,5 +27,5 @@
|
|||
<%= render :partial => 'memos/topic_form' %>
|
||||
</div>
|
||||
|
||||
<%= link_to l(:button_back), forum_path(@forum) %>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue