lib/attrtastic/semantic_attributes_builder.rb in attrtastic-0.4.2 vs lib/attrtastic/semantic_attributes_builder.rb in attrtastic-0.4.3
- old
+ new
@@ -275,11 +275,13 @@
#
# @example
# <%= attr.attribute :label => "User link" do %>
# <%= link_to @user.full_name, user_path(@user) %>
#
+ # Options can be set globally with Attrtastic.default_options
def attribute(*args, &block)
options = args.extract_options!
+ options.reverse_merge!(Attrtastic.default_options)
options[:html] ||= {}
method = args.shift
html_label_class = [ "label", options[:html][:label_class] ].compact.join(" ")