Rails 3 - Ideal way to set title of pages

后端 未结 13 1257
失恋的感觉
失恋的感觉 2020-12-04 06:33

Whats the proper way to set the page title in rails 3. Currently I\'m doing the following:

app/views/layouts/application.html:


  

        
13条回答
  •  庸人自扰
    2020-12-04 07:02

    My answer is more simple:

    locales/any_archive.yml:

    pt-BR:
      delivery_contents:
        title: 'Conteúdos de Entregas'
    
      groups:
        title: 'Grupos'
    

    And inside of application.html.slim:

    title
      = "App Name: #{t("#{controller_name.underscore}.title")}"
    

提交回复
热议问题