https://github.com/alexwayfer/flame-flash
Flash plugin for Flame-framework
https://github.com/alexwayfer/flame-flash
flame flame-plugin flash flashes ruby
Last synced: about 1 year ago
JSON representation
Flash plugin for Flame-framework
- Host: GitHub
- URL: https://github.com/alexwayfer/flame-flash
- Owner: AlexWayfer
- License: mit
- Created: 2016-02-10T21:44:20.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2025-04-04T12:46:05.000Z (about 1 year ago)
- Last Synced: 2025-04-09T22:08:55.074Z (about 1 year ago)
- Topics: flame, flame-plugin, flash, flashes, ruby
- Language: Ruby
- Size: 165 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Flame Flash
[](https://cirrus-ci.com/github/AlexWayfer/flame-flash)
[](https://codecov.io/gh/AlexWayfer/flame-flash)
[](https://codeclimate.com/github/AlexWayfer/flame-flash)

[](https://inch-ci.org/github/AlexWayfer/flame-flash)
[](https://rubygems.org/gems/flame-flash)
[](LICENSE.txt)
[Flashes](http://guides.rubyonrails.org/action_controller_overview.html#the-flash)
for [Flame](https://github.com/AlexWayfer/flame).
## Usage
```ruby
# Gemfile
gem 'flame-flash'
# config.ru
require 'flame-flash' # or `Bundler.require`
# _controller.rb
include Flame::Flash
```
```erb
<%
%i[error warning notice].each do |type|
flash[type].each do |text|
%>
<%= text %>
<%
end
end
%>
```
## Examples
```ruby
class PostsController < Flame::Controller
def update
flash[:error] = "You don't have permissions"
redirect :show
end
def delete
redirect :show, notice: 'Deleted'
end
def move
redirect :index, flash: { success: 'Moved' }
end
def create
flash.now[:error] = 'Not enought permissions'
view :new
end
end
```
### Reserved keys
* `error`
* `warning`
* `notice`
## Development
After checking out the repo, run `bundle install` to install dependencies.
Then, run `toys rspec` to run the tests.
To install this gem onto your local machine, run `toys gem install`.
To release a new version, run `toys gem release %version%`.
See how it works [here](https://github.com/AlexWayfer/gem_toys#release).
## Contributing
Bug reports and pull requests are welcome on [GitHub](https://github.com/AlexWayfer/flame-flash).
## License
The gem is available as open source under the terms of the
[MIT License](https://opensource.org/licenses/MIT).