Permalink
Browse files

* Fixed incurve for Rails 2.x

  • Loading branch information...
stefanoverna committed Sep 12, 2010
1 parent 7617612 commit 75eeffe3329d4106c6487e0bb141eb1207cf09ef
Showing with 12 additions and 3 deletions.
  1. +12 −3 lib/incurve/view_helpers.rb
@@ -1,11 +1,20 @@
module InCurve
module ViewHelpers
-
+
def incurve_css(&block)
c = capture(&block)
premailer = StringPremailer.new(StringIO.new(c))
- premailer.to_inline_css.html_safe
+ inlined = premailer.to_inline_css
+
+ if Rails::VERSION::MAJOR == 2
+ concat(inlined, proc.binding)
+ elsif Rails::VERSION::MAJOR == 3
+ inlined.html_safe
+ else
+ puts "Whoa! inline gem can only work with Rails 2.x and Rails 3.x"
+ end
+
end
-
+
end
end

0 comments on commit 75eeffe

Please sign in to comment.