Skip to content

Instantly share code, notes, and snippets.

@jeremyruppel
Created June 10, 2013 19:24

Revisions

  1. jeremyruppel created this gist Jun 10, 2013.
    18 changes: 18 additions & 0 deletions asset_helper.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    module AssetHelper

    ##
    # Renders a stylesheet asset inline.
    def inline_stylesheet( name )
    content_tag :style do
    sprockets[ "#{name}.css" ].to_s
    end
    end

    ##
    # Renders a javascript asset inline.
    def inline_javascript( name )
    content_tag :script do
    sprockets[ "#{name}.js" ].to_s
    end
    end
    end
    6 changes: 6 additions & 0 deletions layout.html.haml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    !!!
    %html{ html_attrs }
    %head
    = inline_stylesheet 'application'
    = inline_javascript 'application'
    / ...