assets_booster 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/assets_booster/version.rb +1 -1
- data/lib/assets_booster/view_helper.rb +14 -2
- metadata +1 -1
@@ -1,7 +1,19 @@
|
|
1
1
|
module AssetsBooster
|
2
2
|
module ViewHelper
|
3
|
-
def style_tag(
|
4
|
-
|
3
|
+
def style_tag(content_or_options_with_block = nil, html_options = {}, &block)
|
4
|
+
content =
|
5
|
+
if block_given?
|
6
|
+
html_options = content_or_options_with_block if content_or_options_with_block.is_a?(Hash)
|
7
|
+
capture(&block)
|
8
|
+
else
|
9
|
+
content_or_options_with_block
|
10
|
+
end
|
11
|
+
|
12
|
+
content_tag(:style, style_cdata_section(content), html_options.merge(:type => Mime::CSS))
|
13
|
+
end
|
14
|
+
|
15
|
+
def style_cdata_section(content)
|
16
|
+
"\n/*#{cdata_section("*/\n#{content}\n/*")}*/\n".html_safe
|
5
17
|
end
|
6
18
|
|
7
19
|
def assets_booster_tag(type, *names)
|