-
Notifications
You must be signed in to change notification settings - Fork 79
Add flash data #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add flash data #306
Conversation
a15a9c1 to
47b3055
Compare
Deploying inertia-rails with
|
| Latest commit: |
3318748
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://46c5f1cd.inertia-rails.pages.dev |
| Branch Preview URL: | https://flash-props.inertia-rails.pages.dev |
2283f20 to
e11e697
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds flash data functionality to InertiaRails, enabling one-time notifications that don't persist in browser history. Flash data is ideal for success messages, toast notifications, or other temporary values that should only appear once and not when users navigate through browser history.
Key changes:
- Introduces
inertia_flashcontroller method for setting flash data via hash assignment syntax - Adds support for passing flash data via
redirect_to url, inertia: { flash: {...} } - Flash data appears at page level (not in props) and is automatically cleared after rendering
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/inertia/flash_sharing_spec.rb | Comprehensive test coverage for flash data including redirects, accumulation across multiple redirects, stale version handling, and partial updates |
| spec/dummy/config/routes.rb | Adds test routes for flash data controller actions |
| spec/dummy/app/controllers/inertia_test_controller.rb | Implements test controller actions demonstrating both flash data syntaxes and edge cases |
| lib/inertia_rails/renderer.rb | Retrieves flash data from controller and adds it to page response at root level |
| lib/inertia_rails/middleware.rb | Updates session cleanup logic to include flash data deletion and improves comment clarity |
| lib/inertia_rails/controller.rb | Adds inertia_flash method and capture_inertia_session_options logic to handle flash data with validation |
| docs/guide/shared-data.md | Replaces old flash messages section with reference to new flash data documentation |
| docs/guide/flash-data.md | Complete documentation for flash data feature with examples for all frameworks and TypeScript configuration |
| docs/guide/events.md | Documents the new flash event for handling flash data centrally |
| docs/.vitepress/config.mts | Adds flash data documentation to navigation menu |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
05f3596 to
029767b
Compare
029767b to
8146fa8
Compare
8146fa8 to
3318748
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 43 out of 46 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.