ruby-on-railsrails-flash

Rails flash not showing up on the server


I have a rails 4.2.0 app running and my flash alerts are not showing up on my review server but it works just fine in development and production. I setup these couple of test actions in a controller in all three environments and the only one that doesn't work is review:

  def test
    flash[:notice] = 'test alert'
    redirect_to test1_path
  end

  def test1
    flash[:notice] ||= 'This is hard coded alert'
    render text: flash[:notice]
  end

Visiting /test on development and production redirects to /test1 and display test alert. In my review environment, redirect happens but shows This is hard coded alert.

Can there be any server config that would prevent flash alerts from showing up? Any clue about what this might be related to is very appreciated.


Solution

  • Flash notices use the session to pass from request to request.

    Check if that server handles the session any differently in config/application.rb or config/environments/review.rb.

    The default Rails session store is cookies, but maybe this server is configured to use something else?