Question about Upcase _head_contents.html.erb partial

Hi,

In the Upcase repository, in the app/views/application/_head_contents.html.erb partial, there is a piece of code I’m not fully understand. I guess it shows a default description when no specific desription value is passed to the layout file:

<meta http-equiv="Description" name="Description" content="<%= yield(:meta_description).presence || t('layouts.meta_description') %>" />

What does this t() do? and where does layouts.meta_description come from?

thanks for the advice,

greetings,

Anthony

It is a rails helper method for internationalization.

http://apidock.com/rails/ActionView/Helpers/TranslationHelper/translate

layouts.meta_description comes from config/locales/{language}.yml

1 Like

Hi Frank,

Thanks for the explanation!

greetings,

Anthony