You must set flash [: error] in the controller, but you can use it if you want to send it by reference. Move the: error option to the route call:
link_to 'Page', page_path(foobar, :error => "Flash message")
- ,
flash [: error] = params [: error] || ", "
, URL-, URL- ()
"/pages/123?error=Flash%20message
- .