0
Here's the Bootply如何渲染這些Bootstrap 3面板?
我該如何渲染這些面板tp是內聯的?我沒有看到我在這裏失蹤,我有一個container
,我有一個row
,我有col-md-4
嵌套在行內?
對於上下文,這些面板中的每一個均以'_quotes.html.erb'部分編寫,該部分由'index.html.erb'視圖內的Quotes.all.each
塊顯示。
index.html.erb
<div class="container">
<div class="row">
<% @quotes.each do |quote| %>
<%= render :partial => "quote", locals: {quote: quote} %>
<% end %>
</div>
_quote.html.erb
<% @quote = local_assigns[:quote] %>
<%= link_to quote_path(@quote) do %>
<section id="quotes">
<!-- <div class="container"> -->
<div class="col-md-4 col-md-4 col-md-4 text-center">
<div class="panel panel-success panel-quote link-panel">
<div class="panel-heading">
<strong>GLA</strong>
</div>
<div class="panel-body">
<p><strong>Quote ID; <%= @quote.id %></strong></p>
</div>
<table class="table table-bordered">
<tr>
<td>Company name</td>
<td><%= @quote.co_name %></td>
</tr>
<tr>
<td>Company number</td>
<td><%= @quote.co_number %></td>
</tr>
<tr>
<td>Office postcode</td>
<td><%= @quote.postcode %></td>
</tr>
<tr>
<td>Industry</td>
<td><%= @quote.industry %></td>
</tr>
<tr>
<td>Previous cover</td>
<td><%= @quote.prev_cover %></td>
</tr>
<tr>
<td>Lives overseas</td>
<td><%= @quote.lives_overseas %></td>
</tr>
<tr>
<td>Scheme start date</td>
<td><%= @quote.scheme_start_date %></td>
</tr>
<tr>
<td>Payment frequency</td>
<td><%= @quote.payment_frequency %></td>
</tr>
<tr>
<td>Commission level</td>
<td><%= @quote.commission_level %></td>
</tr>
</table>
</div>
</div>
<!-- </div> -->
</section>
</div>
<% end %>
不錯,真不錯感謝#shadowfox,我現在就可以得到它在Bootply做工精細,如上面更新,但在我的實際RoR應用程序第2條記錄不渲染內聯,但每個下方另外,只有第3條第4條和第5條記錄纔會內聯顯示。代碼在上面的問題正文中更新,任何想法這裏發生了什麼? – jbk
我認爲bootply的更新失敗了,因爲它向我展示了我爲你製作的一個:) – Shadowfox