Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added view helpers

  • Loading branch information...
commit 1cdd84cd938c6aa4df04e7d56cda907930c9e561 1 parent e1893a0
@kristianmandrup authored
View
10 README.md
@@ -73,6 +73,16 @@ selector
{ display: box }
```
+### View helpers
+
+```haml
+= flexie_script
+```
+
+Renders:
+
+ <!--[if lte IE 8]><script src="js/flexie.js"></script><![endif]-->
+
### Flex box helpers
The following stylesheets with CSS helper classes are included.
View
5 lib/flexlayout-rails.rb
@@ -1,6 +1,11 @@
+require 'flexlayout/view_helpers'
+
module FlexLayout
module Rails
class Engine < ::Rails::Engine
+ initializer 'flexlayout config' do
+ ActionView::Base.send :include, FlexLayout::ViewHelpers
+ end
end
end
end
View
7 lib/flexlayout/view_helpers.rb
@@ -0,0 +1,7 @@
+module FlexLayout
+ module ViewHelpers
+ def flexie_script
+ raw('<!--[if lte IE 8]><script src="js/flexie.js"></script><![endif]-->').html_safe
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.