How rails redirect_to Carries Return Parameters

  question, ruby

With the code generated by scaffolding, notice can be displayed at the front end.

redirect_to users_url, notice: 'Succeed.'
<p id="notice"><%= notice %></p>

But I added a message and failed

redirect_to users_url, notice: 'Succeed.', message: 'test'
<p id="notice"><%= notice %></p>
 < h1><%= params[:message] %></h1> # not displayed
 < h1><%= message %></h1> # error. message does not exist

Notice: ‘Succeed.’ is the parameter of redirect_to, the parameter in params is passed by url, and users_url is used to generate url, so your writing style should be
redirect_to users_url(message: ‘test’), notice: ‘Succeed.’