Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevyder/puffly
Fun and cute flash messages for your ruby on @rails application. :+1:
https://github.com/kevyder/puffly
cute-flash-messages rails ruby rubygem sass
Last synced: 2 months ago
JSON representation
Fun and cute flash messages for your ruby on @rails application. :+1:
- Host: GitHub
- URL: https://github.com/kevyder/puffly
- Owner: kevyder
- License: mit
- Created: 2016-12-27T03:33:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-21T17:35:40.000Z (9 months ago)
- Last Synced: 2024-10-27T23:21:51.768Z (3 months ago)
- Topics: cute-flash-messages, rails, ruby, rubygem, sass
- Language: Ruby
- Homepage:
- Size: 34.2 KB
- Stars: 18
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Puffly
[![Gem Version](https://badge.fury.io/rb/puffly.svg)](https://badge.fury.io/rb/puffly)
[![Gem](https://img.shields.io/gem/dt/puffly)](https://rubygems.org/gems/puffly)Fun and cute flash messages for your Ruby on Rails application.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'puffly'
```And then execute:
$ bundle install
Or install it yourself as:
$ gem install puffly
Once installed, add the following to your `application.scss`:
```scss
@import "puffly";
```and your `application.js`:
```js
//= require puffly
```## Usage
Add this lines to your `application.erb` or the main layout of your application:
```erb
<% flash.each do |type, msg| %>
<%= content_tag :span, msg, class: "#{type}", id: "puffly" %>
<% end %>
```And add the flash message to the action of your controller:
```ruby
flash[OPTION] = "Your message"
```You can set some options when creating a flash message.
OPTION | SASS Variable | HEX Color
------------ | ------------- | -------------
:success | $color-sucess | `#3DC763`
:error | $color-error | `#ED3D3D`
:warning | $color-warning | `#FF9800`
:notice | $color-notice | `#2B5C7F`
:alert | $color-alert | `#03A9F4`## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/kevyder/puffly.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).