I have a view from which I make an ajax request to the controller and after the action is successfully completed I initialize the flash.now[:notice]. But af
If you use form_with you need to use local: true
form_with
local: true
<%= form_with @user, local: true do |f| %> <%= f.label :name %> <%= f.text_field :name %> <%= f.submit %> <% end %>