【问题标题】:Rails HTML embedding not working correctlyRails HTML嵌入无法正常工作
【发布时间】:2016-01-22 04:14:44
【问题描述】:

所以我试图在我的一个页面上显示一些博客类型的数据。它工作正常,但也在 div 的末尾发布所有帖子。 像这样:

Image

<div class="style-2 mb-20 shadow bordered light-gray-bg news-margin col-md-5">
  <!-- page-title start -->
  <!-- ================ -->
  <h1 class="page-title">Latest News</h1>
  <div class="separator-2"></div>
  <!-- page-title end -->
  <p class="lead">The latest news will be posted here:</p>
  <div class="row grid-space-12">

    <%=@ news.each do |news| %>

      <div class="col-sm-12">
        <div class="image-box style-2 mb-20 shadow bordered text-center">
          <div class="overlay-container">
            <i class="fa fa-newspaper-o fa-5x p-20"></i>
            <div class="overlay-to-top">
              <p class="small margin-clear"><em> <%= news.topic %> <br> <%= news.created_at.strftime("%A, %b %d") %></em>
              </p>
            </div>
          </div>
          <div class="body">
            <h3><%= news.header %></h3>
            <div class="separator"></div>
            <p>
              <%=n ews.content %>
            </p>
            <a href="" class="btn btn-default btn-sm btn-hvr hvr-shutter-out-horizontal margin-clear">Read More<i class="fa fa-arrow-right pl-10"></i></a>
          </div>
        </div>
      </div>

      <% end %>

  </div>
</div>

【问题讨论】:

    标签: ruby-on-rails ruby html ruby-on-rails-4 each


    【解决方案1】:

    想通了,我在 ,正在打印该信息...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-06-10
      • 1970-01-01
      • 2021-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多