https://github.com/imdrasil/flash_container.cr
Simple framework-agnostic flash message container.
https://github.com/imdrasil/flash_container.cr
crystal-language flash-messages
Last synced: 6 months ago
JSON representation
Simple framework-agnostic flash message container.
- Host: GitHub
- URL: https://github.com/imdrasil/flash_container.cr
- Owner: imdrasil
- License: mit
- Created: 2019-01-04T20:39:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-04T20:55:08.000Z (almost 7 years ago)
- Last Synced: 2025-02-05T11:48:31.802Z (8 months ago)
- Topics: crystal-language, flash-messages
- Language: Crystal
- Homepage:
- Size: 2.93 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flash_container
Simple framework-agnostic flash message container.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
flash_container:
github: imdrasil/flash_container.cr
```
2. Run `shards install`## Usage
```crystal
require "flash_container"# Load flash messages from session
flash = FlashContainer.from_session(session.string?(FlashContainer.key))flash[:notice] = "Some message"
# Write messages back to session
session.string(FlashContainer.key, flash.to_session)
```## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
Inspired by `Amber::Router::Flash::FlashStore`.
- [Roman Kalnytskyi](https://github.com/imdrasil) - creator and maintainer