Is it possible to access array elements directly with Rails's t()
For example, if I have this translation defined in my YAML file
title: Contact us
- (123) 456-7890
Then in my view, how can I get to international phone number (second
array item) directly?
I tried all of following, but non of them works.
<%= t 'contact_page.phones' %>
<%= t 'contact_page.phones.1' %>
<%= t 'contact_page.phones.' %>
Some google results suggest first form should work, but it doesn't
work for me. However, code below does work as it should, but its a bit
cumbersome to use, so I was hoping there is a way to get to array
elements directly by specifying their index in the string identifier
<%= t('contact_page.phones') %>
Thanks for your help!