From fb2200f0407c9cbd11ae0aecfab212442a1c4057 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 2 Jan 2013 17:59:38 -0500 Subject: [PATCH 1/3] better rails config check --- lib/semantic_rails_view_helpers/engine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/semantic_rails_view_helpers/engine.rb b/lib/semantic_rails_view_helpers/engine.rb index 3713f95..353974b 100644 --- a/lib/semantic_rails_view_helpers/engine.rb +++ b/lib/semantic_rails_view_helpers/engine.rb @@ -5,7 +5,7 @@ module SemanticRailsViewHelpers initializer 'semantic_rails_view_helpers.initialize', :before => :load_config_initializers do |app| ActionView::Base.send :include, SemanticRailsViewHelpers::ViewHelpers - app.config.add_semantic_data = false if app.config.add_semantic_data.blank? + app.config.add_semantic_data = false if !app.config.respond_to?(:add_semantic_data) end end end From 4f01867bbe5e6a157f2b9aff4f598da8d5c24132 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 4 Jan 2013 10:21:53 -0500 Subject: [PATCH 2/3] will need to include capybara and rspec elsewhere for this to work nicely --- semantic_rails_view_helpers.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semantic_rails_view_helpers.gemspec b/semantic_rails_view_helpers.gemspec index a2746fa..0230721 100644 --- a/semantic_rails_view_helpers.gemspec +++ b/semantic_rails_view_helpers.gemspec @@ -15,6 +15,6 @@ Gem::Specification.new do |gem| gem.require_paths = ["lib"] gem.version = SemanticRailsViewHelpers::VERSION - gem.add_dependency 'capybara' - gem.add_dependency 'rspec' + #gem.add_dependency 'capybara' + #gem.add_dependency 'rspec' end From 3ecbfd904b055f94204398034d130eb845773bd6 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 11 Jan 2013 16:01:56 -0500 Subject: [PATCH 3/3] support integer fields --- lib/semantic_rails_view_helpers/attributes_builder_base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/semantic_rails_view_helpers/attributes_builder_base.rb b/lib/semantic_rails_view_helpers/attributes_builder_base.rb index 7d14aa3..0ea6e62 100644 --- a/lib/semantic_rails_view_helpers/attributes_builder_base.rb +++ b/lib/semantic_rails_view_helpers/attributes_builder_base.rb @@ -42,7 +42,7 @@ module SemanticRailsViewHelpers value = @context.render(:partial => "attributes/#{options[:as]}", :locals => { :object => @object, :field => field, :raw_value => raw_value, :value => value }) end - (value or '').html_safe + (value or '').to_s.html_safe end def field!(field, options = {}, &block)