Module: AssetsBooster::ViewHelper
- Defined in:
- lib/assets_booster/view_helper.rb
Instance Method Summary collapse
- #assets_booster_tag(type, *names) ⇒ Object
- #style_cdata_section(content) ⇒ Object
- #style_tag(content_or_options_with_block = nil, html_options = {}, &block) ⇒ Object
Instance Method Details
#assets_booster_tag(type, *names) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/assets_booster/view_helper.rb', line 19 def assets_booster_tag(type, *names) = names. packages = AssetsBooster::Railtie.packager.packages[type] html = names.map do |name| packages[name].view_helper(self, ) end*"\n" html.html_safe end |
#style_cdata_section(content) ⇒ Object
15 16 17 |
# File 'lib/assets_booster/view_helper.rb', line 15 def style_cdata_section(content) "\n/*#{cdata_section("*/\n#{content}\n/*")}*/\n".html_safe end |
#style_tag(content_or_options_with_block = nil, html_options = {}, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/assets_booster/view_helper.rb', line 3 def style_tag( = nil, = {}, &block) content = if block_given? = if .is_a?(Hash) capture(&block) else end content_tag(:style, style_cdata_section(content), .merge(:type => Mime::CSS)) end |