2011-06-14 71 views
0

我的情景:泡泡通知通过重定向

在我的控制器,确认用户后,我重定向到根(登陆页:statics#landing),我附上一张告示:

redirect_to root_url, notice: 'Confirmation successful.' 

但在那里,我经常检查,如果用户已登录,如果是这样,我重定向到他的实际指数:

def landing 
    redirect_to actual_index_url if (user.signed_in?) 
end 

我怎么能PROPAG在最后一页吃了确认通知?

回答

2

尝试:

def landing 
    redirect_to actual_index_url, :notice => flash[:notice] if (user.signed_in?) 
end 
0

flash.keep(:notice) - 如果你想只保留通知只是flash.keep将保持双方:notices:errors