0
這是我的控制器中的我的動作代碼。在flash通知中放置參數是否安全?
def index
if params[:writer]
if Article.published.where('writer = ?', params[:writer]).count < 1
redirect_to articles_url, :notice => "There are no articles by #{params[:writer]}"
else
@articles = Article.published.where('writer = ?', params[:writer]).order('published_at DESC').page(params[:page]).per(20)
end
else
@articles = Article.published.order('published_at DESC').page(params[:page]).per(20)
end
end
我認爲這個問題相當明顯。在一些簡單的測試中,Rails似乎逃脫了:notice
就好,但我想確保我沒有這樣做而要求麻煩。
呀,我的閃光燈不標記html_safe任何地方。 – Preacher