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
Written by Dinesh Vasudevan
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#