Rails Flash.now not working

后端 未结 5 884
-上瘾入骨i
-上瘾入骨i 2020-12-23 16:56

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

5条回答
  •  有刺的猬
    2020-12-23 17:55

    If you use form_with you need to use local: true

    <%= form_with @user, local: true do |f| %>
      <%= f.label :name %>
      <%= f.text_field :name %>
      <%= f.submit %>
    <% end %>
    

提交回复
热议问题