Module: InCurve::ViewHelpers

Defined in:
lib/incurve/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#incurve_css(&block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/incurve/view_helpers.rb', line 4

def incurve_css(&block)
  c = capture(&block)
  premailer = StringPremailer.new(StringIO.new(c))
  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