Even if I write as below, the flash message is not displayed and msg is included in the query parameter.
redirect_to action: :new, alert: 'msg'
Describe as follows.
redirect_to({:action => :new} , {:alert => 'msg'})
Use redirect_to as follows.
redirect_to(options = {}, response_options = {})
If you write it like the beginning, the flash message will also be treated as the first argument.
redirect_to action: :new, alert: 'msg'
↓
redirect_to({:action => :new, :alert => 'msg'}, { })
Recommended Posts