question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set flash message

See original GitHub issue

I’m using Sprig for some Campaign subscribe/unsubscribe toggles like this:

<button sprig s-method="post" s-action="campaign/forms/unsubscribe" s-val:mailingList="{{ list.slug }}" s-val:email="{{ currentUser.email }}" s-target="#comms">
    Subscribe/Unsubscribe
</button>

Is there a way I can set a flash message when doing it this way? In my other forms I’m doing {{ hiddenInput('successMessage', 'Success.'|hash) }}.

Thanks for your support as always!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
shifumacommented, Oct 15, 2022

Yep good shout. I’ll keep learning and playing. Thanks for your help @mattstein!

0reactions
bencrokercommented, Oct 14, 2022

I second @mattstein’s suggestion of using JavaScript to make this work for your use-case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set a flash message in Yii2? - Stack Overflow
A flash message is used in order to keep a message in session through one or several requests of the same user. By...
Read more >
How to Use Flash Messages in Rails - RubyGuides
A flash message is a way to communicate information with the users of your Rails application so they can know what happens as...
Read more >
How to work with flash messages | Wiki | Yii PHP Framework
A flash message is used in order to keep a message in session through one or several requests of the same user. By...
Read more >
Flash - 4.x - CakePHP Cookbook
FlashComponent provides a way to set one-time notification messages to be displayed after processing a form or acknowledging data. CakePHP refers to these ......
Read more >
Application Layout and Flash Messages
We can set a flash message in the controller, which is stored as a temporary cookie on the user's browser.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found