Improve some models

This commit is contained in:
Bernie Chiu 2013-08-25 14:49:02 +08:00 committed by chris
parent f94e675ca0
commit 9625aa0f8b
3 changed files with 7 additions and 8 deletions

View File

@ -78,11 +78,10 @@ class ArchiveFile
end
def save_archive_file_multiples
self.archive_file_multiples.each do |t|
if t.should_destroy
t.destroy
end
self.archive_file_multiples.each do |t|
if t.should_destroy
t.destroy
end
end
end
end

View File

@ -23,9 +23,9 @@ class DictionaryVocab
# field :is_hot, :type => Boolean, :default => false
# field :is_hidden, :type => Boolean, :default => false
# scope :can_display,where(is_hidden: false)
scope :can_display, where(is_hidden: false)
# belongs_to :archive_file_category
belongs_to :dictionary_vocab_category
# has_many :archive_file_multiples, :autosave => true, :dependent => :destroy

View File

@ -2,6 +2,6 @@
<%= hidden_field_tag :category_id, params[:category_id] %>
<p>
<%= text_field_tag :search_query, params[:search_query],{ value: (params[:search_query].blank? ? '' : params[:search_query]), placeholder: t("dictionary.widget.search") }%>
<%= submit_tag "Search", name: nil %>
<%= submit_tag t("dictionary.widget.search"), name: nil %>
</p>
<% end %>