2016-01-14 31 views
-1

请通过指出为什么下面创建的按钮不会位于网页的右侧来帮助我。我在index.html.erb中有这样的代码Bootstrap 4.0.0 alpha3 Rails 4.2.5 Bootstrap btn pull-right不起作用

<div class = "page-header"> 
    <%= link_to "New Product" , new_product_path , :class => "btn btn-success pull-right" %> 
    <h3>All Products</h3> 
</div> 

<div class = ''row"> 
    <% @products.each do |product| %> 
    <div class = "col-xs-12 col-sm-6 col-md-4 col-lg-3 text-center"> 
     <h2><%= product.name %></h2> 
     <img class = "img-responsive" src = <%= asset_path product.featImage %>/> 
     <p><%= product.description %></p> 
     <h4>$<%= product.price %></h4> 
     <%= link_to "Show" , product , :class => "btn btn-primary" %> 
    </div>`enter code here` 
    <% end %> 
</div> 
+0

如果可能的话,我会包括一个小提琴。 – Shawn

+0

什么是小提琴? –

+0

您需要在[代码片段](https://blog.stackoverflow.com/2014/09/introducing-runnable-javascript-css-and-html-code-snippets)中发布您的呈现HTML(以及任何其他CSS) /)所以有一个实际的工作示例来演示问题。参见[mcve]和[问]。 – vanburen

回答

0

要解决此问题,我将回到最新的3系列之前的宝石版本。即引导-SASS 3.3.6

在Gemfile中写:

引导。

宝石 “引导 - 萨斯”, “〜> 3.3.6”

这将解决这个问题。看来Bootstrap 4.0.0 aplha3不支持“class =”btn btn-success pull-right“”