https://github.com/atrox/sweetify
SweetAlert flash messages for Ruby on Rails
https://github.com/atrox/sweetify
flash-messages rails sweetalert
Last synced: 11 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 (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-05-05T15:23:59.000Z (almost 7 years ago)
- Last Synced: 2025-02-03T01:11:46.472Z (about 1 year ago)
- Topics: flash-messages, rails, sweetalert
- Language: Ruby
- Homepage: https://rubygems.org/gems/sweetify
- Size: 8.79 KB
- Stars: 21
- Watchers: 6
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sweetify - SweetAlert for Rails
[](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' %>