Improve some models
This commit is contained in:
parent
f94e675ca0
commit
9625aa0f8b
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 %>
|
Loading…
Reference in New Issue