jeudi 23 juillet 2015

how to make first word of title capitalize in ruby? String comes from en.yml file

I have en.yml file and in that file there is attribute named as query. query is the one which is getting appended to the title of the page as query results. For example if you search hi my name is then title of the page would be hi my name is results. Thus I want it to be Hi my name is. I want the first letter of the query string capital.

Here is the code:

- title(see_more_search? ? t('.metadata.title.see_more') : (scrubbed_query.present? ? t('.metadata.title.with_query', query: scrubbed_query)))

And idea how to solve this?

Aucun commentaire:

Enregistrer un commentaire