Ruby on rails 仅在主页上添加元关键字和说明

Ruby on rails 仅在主页上添加元关键字和说明,ruby-on-rails,Ruby On Rails,我只想输入ruby网站主页的关键词和描述。 主页有2个文件: 1- main_controller 2- home_page.html.erb <% content_for :html_title, 'Erratum HUmanum Est' %> <div class="clear"></div> <div id="video"> <div class="container"> <div class="v

我只想输入ruby网站主页的关键词和描述。 主页有2个文件:

1- main_controller
2- home_page.html.erb


<% content_for :html_title, 'Erratum HUmanum Est' %>
<div class="clear"></div>
<div id="video">
  <div class="container">
        <div class="video-glow">
          <h1><%= t('application.home_page.heading')%></h1>
            <div class="clear"></div>
            <div class="video-section">
                <iframe width="418" height="235" src="https://www.youtube.com/embed/sfsfsfsfsfsfQ?rel=0;hd=1" frameborder="0" allowfullscreen></iframe>
            </div>
        </div>
    </div>
</div>
1-主控制器
2-home_page.html.erb
如何在这些页面上输入元描述和关键字?(我不想为此输入任何新的ruby gem) 谢谢,
Roman

应用程序.html.erb
中添加类似的内容

<meta name="description" content="<%= yield(:description) %>" />
<meta name="keywords" content="<%= yield(:keywords) %>" />
<%= provide(:description, 'I would like to enter keywords and a description of the home page only of my ruby website. The home page has ') %>  
<%= provide(:keywords, 'Home, fred, grace, heaven, george') %>  

当您没有传递任何内容时,它将保持为空,没有meta_标记。

非常感谢。您确认这只会影响主页而不会影响网站的其他页面吗?它只会显示您提供数据的位置。如果它对你有效,那么把它标记为答案。