2011-06-14 68 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