Search code examples
hanami

Feedback message in LotusRB


What is the suggested way to set a feedback message in Lotus? Something like flash messages in Rails.

In my create action I create my entity and after I redirect to index. Now I'd like to display in index a "entity successfully saved" message.

Thanks


Solution

  • flash is already shipped, but not documented yet because still unstable.

    To use it, please enable sessions in apps/web/application.rb and use it in actions/views/templates like a Hash.

    Please have a look at: https://github.com/lotus/controller/blob/bb2f4b971adbff6ce4a2e050a08d4b1837bc848d/lib/lotus/action/flash.rb