Using Rails 3.0.3 combined with the same skills as devise. I do not receive any flash messages. Now I mention devise because it controls the cookies used for authentication.
The Rails application is now a little special because it uses subdomains . What they do is the application that the user is viewing. Example: mycompany.theapp.com/projects/3/ <- Project 3 of the company "mycompany".
When a user logs in, he goes to aapp.com/overview <- non subdomain. Each notification is shown there, so why not on subdomain pages?
So this is the code used on subdomain pages. Just like on non-subdomain pages. Code in the controller:
def update redirect_to [@project], :notice => "Project #{@project.name} updated." end
Layouts / application.html.erb
<% flash.each do |type, message| %> <%= content_tag :div, message, :class => "flash #{type}" %> <% end %>
I also added the following, trying to figure out what was going on:
flash.to_yaml # Result: --- !map:ActionDispatch::Flash::FlashHash {}
Since devise seems to use flash [: notice], I also tried this (because it worked for development).
flash[:notice] = "Project #{@project.name} updated."
Now, are notifications sent cookies or session data that is poorly transferred to subdomains? Since the project editing form is at mycompany.theapp.com/projects/3/edit/
And he sends me to mycompany.theapp.com/projects/3/( without notice)
This happens on Ubuntu 10.10 with a "rail server", a passenger using nginx, and even on a Mac machine (but someone else checked this out).
Does anyone want to guess?