Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

here's the fix to make including .coffee files from .js.erb not require a raw #8

Merged
merged 1 commit into from

2 participants

@fringd

commit ac6115a
Author: Ram Dobson ram.dobson@solsystemscompany.com
Date: Thu Jan 26 10:51:25 2012 -0500

add html_safe after compile to fix partials
@markbates markbates merged commit cd25de2 into from
@markbates
Owner

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 26, 2012
  1. @fringd
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/coffeebeans.rb
View
14 lib/coffeebeans.rb
@@ -9,24 +9,24 @@ def self.erb_handler
def self.call(template)
compiled_source = erb_handler.call(template)
- "::CoffeeScript.compile(begin;#{compiled_source};end)"
+ "::CoffeeScript.compile(begin;#{compiled_source};end).html_safe"
end
end
end
-
+
module ViewHelpers
-
+
def coffee_script_tag(&block)
content_tag(:script, coffee_script(&block), :type => 'text/javascript')
end
-
+
def coffee_script(&block)
::CoffeeScript.compile(capture(&block)).html_safe
end
-
+
end
-
+
end
ActionView::Template.register_template_handler :coffee, CoffeeBeans::Handlers::CoffeeScript
-ActionView::Base.send :include, CoffeeBeans::ViewHelpers
+ActionView::Base.send :include, CoffeeBeans::ViewHelpers
Something went wrong with that request. Please try again.