Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
3fef2d8a3c
|
@ -89,10 +89,9 @@ class MemosController < ApplicationController
|
||||||
offset(@reply_pages.offset).
|
offset(@reply_pages.offset).
|
||||||
all
|
all
|
||||||
if @memo.new_record?
|
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
|
else
|
||||||
format.html { render action: :show }#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" }
|
format.html { render action: :show }
|
||||||
# format.html { redirect_to back_memo_or_forum_url}#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" }
|
|
||||||
format.json { render json: @memo.errors, status: :unprocessable_entity }
|
format.json { render json: @memo.errors, status: :unprocessable_entity }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,5 @@
|
||||||
<%= labelled_form_for(@memo, :url => forum_memos_path) do |f| %>
|
<%= 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">
|
<div class="actions" style="max-width:680px">
|
||||||
<p><%= f.text_field :subject, :required => true, :size => 95 %></p>
|
<p><%= f.text_field :subject, :required => true, :size => 95 %></p>
|
||||||
<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor01' %></p>
|
<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor01' %></p>
|
||||||
|
@ -20,6 +10,6 @@
|
||||||
<%= l(:label_attachment_plural) %><br />
|
<%= l(:label_attachment_plural) %><br />
|
||||||
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
|
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
|
||||||
</p>
|
</p>
|
||||||
<%= f.submit :value => l(:label_memo_create) %>
|
<%= f.submit :value => l(:label_memo_create) %> <%= link_to l(:button_back), forum_path(@forum) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
|
@ -27,5 +27,5 @@
|
||||||
<%= render :partial => 'memos/topic_form' %>
|
<%= render :partial => 'memos/topic_form' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= link_to l(:button_back), forum_path(@forum) %>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue