Foundation::Rails::Helpers
This gem is designed to provide an easy to use objected based approach to creating Zurb Foundation HTML elements using a elegant DSL.
Each helper object is available for direct use but they've been aliased for ease of use.
Usage
Here we have an example of creating a foundation panel using a clean DSL:
Foundation::Rails::Helpers::Panel.new do |panel|
panel.content = "Hello, World!"
panel.attributes[:class] = "callout"
end
Typing Foundation::Rails::Helpers::xxx
will get rather tiresome so a view helper is provided:
foundation_panel do |panel|
panel.content = "Hello, World!"
panel.attributes[:class] = "callout"
end
If this is still a little long for you, you can optionally pass the arguments in instead of using block:
foundation_panel(content: "Hello World", attributes: { class: "callout" })
Support
Currently Alert
, Label
, and Panel
have been implemented
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request