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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Resources