I am making config/locales/custom_error.yml
and loading it in config/initializer/app_errors.rb
. It has the following contents:
custom_error.yml
app_flow:
errors:
fill_important_fields: "We recommend you to Fill this form "
app_errors.rb
APP_ERROR = YAML.load_file("#{Rails.root}/config/locales/custom_error.yml")
Now in my application I can access keys like APP_ERROR['app_flow']['errors']['fill_important_fields']
- I read This Question but not the exact same as I'm asking .
My Question
I want to access these nested keys something like class methods / members
like . app_error.errors.fill_important_fields