Module: Quorum::Helpers
- Included in:
- ApplicationController
- Defined in:
- lib/quorum/helpers.rb
Defined Under Namespace
Modules: Colors
Instance Method Summary collapse
-
#set_flash_message(key, kind, options = {}) ⇒ Object
I18n flash helper.
Instance Method Details
#set_flash_message(key, kind, options = {}) ⇒ Object
I18n flash helper. Set flash message based on key.
7 8 9 10 11 12 13 14 |
# File 'lib/quorum/helpers.rb', line 7 def (key, kind, = {}) [:scope] = "quorum.#{controller_name}" [:scope] << ".errors" if key.to_s == "error" [:scope] << ".notices" if key.to_s == "notice" [:scope] << ".alerts" if key.to_s == "alert" = I18n.t("#{kind}", ) flash[key] = if .present? end |