lib/sugar/actionview.rb in krasivotokak-sugar-0.0.21 vs lib/sugar/actionview.rb in krasivotokak-sugar-0.0.22
- old
+ new
@@ -91,10 +91,11 @@
edit_polymorphic_path(something),
:class => 'ajax edit action')
end
def button_to_delete(something, title = nil)
- title ||= t('.delete', :default => "Delete #{something.class.human_name}")
+ title ||= t('.delete',
+ :default => "Delete #{(something.is_a?(Array) ? something.last : something).class.human_name}")
button_to(title,
polymorphic_path(something),
:class => 'delete action',
:method => :delete,
:confirm => t('sure', :default => 'Are you sure?'))