From 9959b2f0166b4b923903e07f2c5e096dabbccd6e Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 6 Mar 2013 07:22:08 -0500 Subject: [PATCH] small cleanup --- .../attributes_builder_base.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/semantic_rails_view_helpers/attributes_builder_base.rb b/lib/semantic_rails_view_helpers/attributes_builder_base.rb index 4642f09..4f23f5b 100644 --- a/lib/semantic_rails_view_helpers/attributes_builder_base.rb +++ b/lib/semantic_rails_view_helpers/attributes_builder_base.rb @@ -17,9 +17,9 @@ module SemanticRailsViewHelpers end def field(field, options = {}, &block) - if options[:value] - raw_value = options[:value] - else + raw_value = options.delete(:value) + + if !raw_value raw_value = @object.send(field) if block @@ -30,12 +30,12 @@ module SemanticRailsViewHelpers value = raw_value value = value.to_label if value.respond_to?(:to_label) - if options[:raw] + if options.delete(:raw) value = (value || '').html_safe end if SemanticRailsViewHelpers.semantic_data? - value = @context.content_tag(:data, value, 'data-field' => field) + value = @context.content_tag(:data, value, options.merge('data-field' => field)) end if options[:as]