Sha256: f2a4b1ef782adf3b5285cf646cb23079853acfd264c20c8044c87d51e2e4e3ef

Contents?: true

Size: 1.93 KB

Versions: 1

Compression:

Stored size: 1.93 KB

Contents

# Twitter Bootswatch Rails Helpers gem

  - Requires [twitter-bootswatch-rails](https://github.com/scottvrosenthal/twitter-bootswatch-rails)
  - Provides view helpers for twitter bootstrap's alerts and breadcrumbs

## Installing Gem

Add this line to your application's Gemfile:

    gem 'twitter-bootswatch-rails'
    gem 'twitter-bootswatch-rails-helpers'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install twitter-bootswatch-rails-helpers

## Demo

The [demo](https://github.com/scottvrosenthal/twitter-bootswatch-rails-demo) will show you how this gem can be used.

## Usages

Please view the [demo](https://github.com/scottvrosenthal/twitter-bootswatch-rails-demo) project to see some examples on how to use these view helpers

Alerts:

```erb
<%= bootswatch_flash_container(:default, true) do %>
  <h4>Alert block</h4><p>Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>
<% end %>
<%= bootswatch_flash_container(:success) do %>
  <strong>Success</strong> You successfully read this important alert message.
<% end %>
<%= bootswatch_flash_container(:error) do %>
  <strong>Error</strong> Change a few things up and try submitting again.
<% end %>
<%= bootswatch_flash_container(:info) do %>
  <strong>Information</strong> This alert needs your attention, but it's not super important.
<% end %>
```

Breadcrumbs:

Place an add_breadcrumb call in the action of your controller:

```ruby
def index
  add_breadcrumb "Test link", root_path
end
```

Place a call to the render_breadcrumbs helper at the top of the view or where you want it to render:

```erb
<%= render_breadcrumbs %>
```


## 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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twitter-bootswatch-rails-helpers-2.3.1 README.md