Last Updated: February 25, 2016
·
369
· dinks

Scoping and default for I18n Rails

I18n.t(
  :bad_things_happen,
  scope: [:level_one, :level_two, :level_three],
  default: I18n.t(
    'flashes.failure_common_html',
     name: 'tester'
   )
 )

Scope it, and default it. And remember _html means its html_safe

Refer : https://github.com/thoughtbot/clearance/blob/master/lib/clearance/default_sign_in_guard.rb#L12