What is the difference when using flash :error, :alert, and :notice?

前端 未结 5 1828
旧巷少年郎
旧巷少年郎 2020-12-25 11:03

As the title of the question asks, I am interested in knowing if there is any difference when using flash[:error], flash[:alert], and flash[:

5条回答
  •  盖世英雄少女心
    2020-12-25 11:57

    I also use a :message class too pass along the StandardError message trapped in my exception handlers. Using 2 or 3 classes allows you to display up to that many messages in response to a single event or result, each conveying a different aspect of the outcome, e.g. informational, an error based on what the application knows and an error based on what the system knows.

提交回复
热议问题