我有一个奇怪的问题,即在IE中没有出现的flash消息(试过8和9):
[notice] Your changes have been saved. Next step...
,即使它没有出现在页面上也是如此!这是我的更新操作:
def update
@form = Forms::Events::EditForm.build_for(@event, params[:event])
if @form.save
redirect_to edit_challenge_path(@form.event, form: @form.event_name), notice: "Your changes have been saved. #{@form.next_form}".html_safe
else
flash.now[:alert] = "Please correct the errors highlighted below."
render "groups/events/edit"
end
end
关于什么可能出错的任何想法?
答案 0 :(得分:2)
同意@ AnthonyAlberto的评论。您想要的是.now
闪光方法,例如flash.now[:alert] = ...
这是good explanation of the difference。