Add time to announcement quick edit

Fix picture for news quick edit
Fix tags not saving when empty
Hide role in quick edit
This commit is contained in:
Christophe Vilayphiou committed 2012-08-14 14:38:21 +08:00
1 parent 77224bcc8f
commit fb53ad524a
15 files changed
+42 -16

No files matched your search

+8
View File
@@ -18,8 +18,16 @@ class Asset
belongs_to :assetable, polymorphic: true
has_and_belongs_to_many :tags, :class_name => "AssetTag"
before_save :clean_tags
def sorted_tags
tags.order_by(I18n.locale, :asc)
end
protected
def clean_tags
self.tag_ids.delete('')
end
end
+1
View File
@@ -26,6 +26,7 @@
<%= content_tag :label, :class => "checkbox inline" do -%>
<%= check_box_tag 'asset[tag_ids][]', tag.id, @asset.tag_ids.include?(tag.id) %>
<%= tag[I18n.locale] %>
<%= hidden_field_tag 'asset[tag_ids][]', '' %>
<% end %>
<% end %>
</div>