Module: BistroCar::Helpers
- Defined in:
- lib/bistro_car/helpers.rb
Instance Method Summary collapse
Instance Method Details
#coffee_script(&block) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/bistro_car/helpers.rb', line 16 def coffee_script(&block) output = BistroCar.compile(capture(&block)) concat content_tag(:script, " //<![CDATA[\n \#{output}\n //]]>\n JAVASCRIPT\nend\n", :type => 'text/javascript', :charset => 'utf-8') |
#coffee_script_bundle(*bundles) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/bistro_car/helpers.rb', line 4 def coffee_script_bundle(*bundles) = bundles. [:mode] ||= BistroCar.mode bundles = [:default, *bundles].map do |name| bundle = Bundle.new(name) render_cs_bundle(bundle, [:mode]) end.join bundles = bundles.html_safe if bundles.respond_to?(:html_safe) bundles end |