diff --git a/CHANGELOG.md b/CHANGELOG.md index 1337c76..e3d2efc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ - # Changelog +## [0.2.0] 2015-10-13 +### Fixes +- Use `font-awesome-rails` to handle icons. + ## [0.1.2] 2015-10-02 ### Changed - Depend on rails instead of railties. diff --git a/Gemfile.lock b/Gemfile.lock index ff196c4..d6e9dae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,8 @@ PATH remote: . specs: - tabs_for (0.1.2) + tabs_for (0.2.0) + font-awesome-rails (~> 4.0) rails (>= 3.2, < 5.0) GEM @@ -54,6 +55,8 @@ GEM domain_name (0.5.24) unf (>= 0.0.5, < 1.0.0) erubis (2.7.0) + font-awesome-rails (4.4.0.0) + railties (>= 3.2, < 5.0) globalid (0.3.6) activesupport (>= 4.1.0) http-cookie (1.0.2) diff --git a/app/helpers/tabs_for/rails/tabs_for_helper.rb b/app/helpers/tabs_for/rails/tabs_for_helper.rb index d2e4c9e..27e302b 100644 --- a/app/helpers/tabs_for/rails/tabs_for_helper.rb +++ b/app/helpers/tabs_for/rails/tabs_for_helper.rb @@ -28,6 +28,7 @@ def identifier(attribute) end class TabBuilder < ViewBuilder + include FontAwesome::Rails::IconHelper def tab(attribute, options = {}) content = if options[:label] @@ -73,7 +74,7 @@ def human_name(attribute_name) end def wrap_with_icon(content, options = {}) - content_tag(:i, " ".html_safe + content, :class => options[:icon]) + fa_icon(options[:icon], text: content) end end diff --git a/lib/tabs_for.rb b/lib/tabs_for.rb index 039a982..b1f92cc 100644 --- a/lib/tabs_for.rb +++ b/lib/tabs_for.rb @@ -1,2 +1,3 @@ require "tabs_for/version" require "tabs_for/engine" +require "font-awesome-rails" diff --git a/lib/tabs_for/version.rb b/lib/tabs_for/version.rb index 97f8a18..beb5201 100644 --- a/lib/tabs_for/version.rb +++ b/lib/tabs_for/version.rb @@ -1,3 +1,3 @@ module TabsFor - VERSION = "0.1.2" + VERSION = "0.2.0" end diff --git a/tabs_for.gemspec b/tabs_for.gemspec index 84b2c5f..1f95624 100644 --- a/tabs_for.gemspec +++ b/tabs_for.gemspec @@ -21,6 +21,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 1.9.3' spec.add_dependency "rails", ">= 3.2", "< 5.0" + spec.add_dependency "font-awesome-rails", "~> 4.0" spec.add_development_dependency "coveralls" spec.add_development_dependency "sqlite3" diff --git a/test/tabs_for_helper_test.rb b/test/tabs_for_helper_test.rb index 077aba1..56b7d88 100644 --- a/test/tabs_for_helper_test.rb +++ b/test/tabs_for_helper_test.rb @@ -59,7 +59,7 @@ def assert_pane(id, text) end test "#tab given the icon option renders the given icon" do - with_concat_tabs_for(object) { |b| b.tab(:name, icon: "fa fa-building") {} } + with_concat_tabs_for(object) { |b| b.tab(:name, icon: "building") {} } assert_select "i[class=\"fa fa-building\"]" end