Sha256: 58add85431368d8c0113255eba6d0760303844109d99d589640f072ed98c99e7

Contents?: true

Size: 1.5 KB

Versions: 1

Compression:

Stored size: 1.5 KB

Contents

# Strappy

Strappy is in its very beginning stages. It is intended to be a collection of bootstrap helpers for Rails 4. The current version only includes a "Flash Messages" helper for displaying flash messages.

## Installation 

Clone the repo, `git clone git://github.com/tommyschaefer/strappy.git`, or [download](https://github.com/tommyschaefer/strappy/archive/master.zip) the current version.

You can include this in your rails project by adding `gem "strappy"` to your Gemfile. After running `bundle install`, you will have access to Strappy's helpers and `rails g strap:install` will generate Bootstrap's files for you.

## Usage

### Flash Messages
Flash messages can be created in two ways in your controller. 

Using the string method, you declare flash messages like so: `flash[:success] = "Message here"`. To make this a dismissable alert, you simply use the following form: `flash[:success] = "[x] Message Here"`.

Using the hash method, you declare your message in the form: `flash[:success] = { msg: "Message" }`. A dismissible alert in this notation would look like: `flash[:success] = { msg: "Message", dismissible: true }`. Not that if you want a non-dismissable alert, you do not have to include the 'dismissable' attribute (although you can).

Alert types include "danger", "info", "warning", and "success." You can see what they look like respectively on the [Twitter Bootstrap website](http://getbootstrap.com/components/#alerts).

In your view, you can render flash messages by including `<%= flash_messages %>`

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
strappy-0.0.02 README.md