Permalink
Browse files

algunas opciones por defecto

  • Loading branch information...
1 parent e17cf8c commit 6aa58caf60198b80df29497c80dd6343b27ce0cc @eeng committed Apr 23, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/nested_form/builder_mixin.rb
View
6 lib/nested_form/builder_mixin.rb
@@ -72,18 +72,20 @@ def link_to_remove(*args, &block)
end
def icon_to_add(*args, &block)
- icon = args.shift
+ icon = args.first.is_a?(String) ? args.shift : 'plus'
options = args.extract_options!.symbolize_keys
options[:class] = [options[:class], "btn btn-small"].compact.join(" ")
+ options[:title] ||= 'Agregar'
link_to_add(*[*args, options]) do
@template.content_tag(:i, '', class: "icon-#{icon}")
end
end
def icon_to_remove(*args, &block)
- icon = args.shift
+ icon = args.first.is_a?(String) ? args.shift : 'minus'
options = args.extract_options!.symbolize_keys
options[:class] = [options[:class], "btn btn-small"].compact.join(" ")
+ options[:title] ||= 'Quitar'
link_to_remove(*[*args, options]) do
@template.content_tag(:i, '', class: "icon-#{icon}")
end

0 comments on commit 6aa58ca

Please sign in to comment.