Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atrox/sweetify
SweetAlert flash messages for Ruby on Rails
https://github.com/atrox/sweetify
flash-messages rails sweetalert
Last synced: 4 months ago
JSON representation
SweetAlert flash messages for Ruby on Rails
- Host: GitHub
- URL: https://github.com/atrox/sweetify
- Owner: Atrox
- License: bsd-3-clause
- Created: 2016-05-07T11:57:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-05T15:23:59.000Z (over 5 years ago)
- Last Synced: 2024-10-13T00:20:44.623Z (4 months ago)
- Topics: flash-messages, rails, sweetalert
- Language: Ruby
- Homepage: https://rubygems.org/gems/sweetify
- Size: 8.79 KB
- Stars: 20
- Watchers: 6
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sweetify - SweetAlert for Rails
[![Gem](https://img.shields.io/gem/v/sweetify.svg?style=flat-square)](https://rubygems.org/gems/sweetify)
This gem allows you to use [SweetAlert](http://t4t5.github.io/sweetalert/) or [SweetAlert2](https://github.com/limonte/sweetalert2) for your flash messages.
_See the examples below, to see how to use it_## Installation
**Note: This package does not provide the client-side files of SweetAlert. You have to provide them yourself.**Add this line to your application's Gemfile:
```ruby
gem 'sweetify'
```And then execute:
```bash
$ bundle
```Next up, create the file `sweetify.rb` in your initializers to specify the library you are using (SweetAlert or SweetAlert2):
```ruby
# possible options: 'sweetalert', 'sweetalert2' - default is 'sweetalert2'
Sweetify.sweetalert_library = 'sweetalert2'
```Next add the following line to the bottom of your application's layout file:
```html
...<%= render 'sweetify/alert' %>