> So given this YAML, how can I get to any specific element in the array
> by calling Rail's t() helper only?
>
> en:
> contact_page:
> title: Contact us
> phones:
> - "(123) 456-7890"
> - "+1987654321"
> - "1-890-123-456"
Rails way is:
I18n.t('contact_page.phones')[N] # where N is an index of Array
I18n already get your locale set from 'config/application.rb' file:
config.i18n.default_locale accessor = …
(:en by default)
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.