隐藏搜索栏 and something...

This commit is contained in:
yanxd 2013-11-27 14:52:36 +08:00
parent 7fe8d46bfc
commit 16c218ccae
3 changed files with 2 additions and 5 deletions

View File

@ -81,6 +81,7 @@ class MemosController < ApplicationController
respond_to do |format|
if(@memo.update_attribute(:subject, params[:memo][:subject]) &&
@memo.update_attribute(:content, params[:memo][:content]))
@memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads]))
format.html {redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}"}
else
format.html { render action: "edit" }

View File

@ -8,7 +8,6 @@ class Memo < ActiveRecord::Base
validates_length_of :subject, maximum: 50
validates_length_of :content, maximum: 2048
validate :cannot_reply_to_locked_topic, :on => :create
validate :content_cannot_be_blank
acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC"
acts_as_attachable
@ -50,9 +49,6 @@ class Memo < ActiveRecord::Base
def cannot_reply_to_locked_topic
errors.add :base, 'Topic is locked' if root.locked? && self != root
end
def content_cannot_be_blank
errors.add :base, "content can't be blank." if self.content.blank?
end
# def update_memos_forum
# if forum_id_changed?

View File

@ -31,7 +31,7 @@
<td class="info_font" style="width: 240px; color: #15bccf">软件项目托管社区</td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="top-content-search">
<div class="top-content-search" style="display:none">
<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'project_type', params[:project_type] %>