Guest User

Untitled

a guest
Jan 22nd, 2018
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. module Helper
  2. def coffeescript_tag(content_or_options_with_block = nil, html_options = {}, &block)
  3. content =
  4. if block_given?
  5. html_options = content_or_options_with_block if content_or_options_with_block.is_a?(Hash)
  6. capture(&block)
  7. else
  8. content_or_options_with_block
  9. end
  10.  
  11. content_tag(:script, javascript_cdata_section(CoffeeScript.compile(content)), html_options.merge(:type => Mime::JS))
  12. end
  13. end
  14.  
  15. ActionView::Base.send :include, Helper
Add Comment
Please, Sign In to add comment