Open wandergithub opened 1 week ago
@wandergithub Awesome job!
The only thing I noticed on my end is that the flash is no longer working. Are you seeing the same thing?
This is on the main branch:
Now that you point that out 🤔 I will take a look.
Something is happening with the template, I think related to turbo stream and how the flash message is being handled but I don't fully understand how it works jet...
Something is happening with the template, I think related to turbo stream and how the flash message is being handled but I don't fully understand how it works jet...
The update action in ActivationsController is implicitly looking for update.turbo_stream.erb
in views/organizations/activations
. You can explicitly render a file that is in a differently path but we probably should stick with convention unless there is a specific reason you can think of not to.
Yeah what @jmilljr24 said. Check out app/views/organizations/staff/staff/update_activation.turbo_stream.erb
. You need this for your new controller and action, so just move that turbo stream view file to the correct view directory for that new controller and rename it to update.turbo_stream.erb
. You will note that this file does two things. It replaces the toggle because it should change after changing the activation, and it renders the flash.
Yeah what @jmilljr24 said. Check out
app/views/organizations/staff/staff/update_activation.turbo_stream.erb
. You need this for your new controller and action, so just move that turbo stream view file to the correct view directory for that new controller and rename it toupdate.turbo_stream.erb
. You will note that this file does two things. It replaces the toggle because it should change after changing the activation, and it renders the flash.
@kasugaijin I don't believe we need the turbo replace of the toggle any longer. I think that was used when the page was rendering two layouts that were user selected(table vs cards). If the user clicked the toggle in the table, the card wouldn't reflect the change until a page fresh.
@jmilljr24 Ah yes we got rid of those cards...good point. We can remove the toggle bit in the turbostream response, then @wandergithub !
It works now!
Thanks guys. Now I understand better how turbo_streams and the real-time update work.
🔗 Issue
https://github.com/rubyforgood/homeward-tails/issues/1106
✍️ Description
Refactor staff deactivation
📷 Screenshots/Demos