Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Twitter引导sass在某些页面上不起作用_Html_Css_Ruby On Rails_Twitter Bootstrap - Fatal编程技术网

Html Twitter引导sass在某些页面上不起作用

Html Twitter引导sass在某些页面上不起作用,html,css,ruby-on-rails,twitter-bootstrap,Html,Css,Ruby On Rails,Twitter Bootstrap,我已经安装了引导sass gem,我发现css在一些页面上有效,而在其他页面上无效,我不知道为什么会这样。下面我包括了它不起作用的视图、gem文件和样式表 档案:- 来源“” application.css.scss:- *= require_self *= require_tree . */ @import "bootstrap"; .html.erb <p><%= notice %></p> <p><%= @basket_it

我已经安装了引导sass gem,我发现css在一些页面上有效,而在其他页面上无效,我不知道为什么会这样。下面我包括了它不起作用的视图、gem文件和样式表

档案:- 来源“”

application.css.scss:-

 *= require_self
 *= require_tree .
 */
 @import "bootstrap";
.html.erb

<p><%= notice %></p>

<p><%= @basket_items.product_totals %><p>

<%= button_to "Purchase products", new_payment_path, :class => "btn" %>

<table class="table table-hover">
 <tr>
  <th>Picture</th>
  <th>Name</th>
  <th>Price</th>
  <th></th>
</tr>
<tr>
  <% @basket_items.each do |item| %>
    <td><p>Nothingness</p></td>
    <td><p><%= item.product.name %></p></td>
    <td><p><%= item.product.price %></p></td>
    <td><%= button_to 'Remove', basket_item_path(item.id), :method => 'delete', :confirm    => 'Are you sure?', :class => "btn" %></td>
  <% end %>
 </tr>
</table>

如果您可以比“不工作”更具体一些,这会有所帮助,但一般来说,如果资产没有正确加载,或者显示的是旧版本的资产,那么您很可能忘记了预编译资产


尝试运行bundle exec rake assets:precompile,然后重新加载页面。

如果您可以比“不工作”更具体一些,这会有所帮助,但通常情况下,如果没有正确加载资产或显示较旧版本的资产,您很有可能忘记预编译资产


尝试运行bundle exec rake assets:precompile,然后重新加载页面。

我遇到了类似的问题。对我来说,这是因为我的供应商目录中有一个资产文件夹,其中有一个样式表文件夹。我假设rails检查了这些文件夹的引导,因为它们存在,而不是导入引导gem?一旦我删除了那些,它就工作得很好。

我也遇到了类似的问题。对我来说,这是因为我的供应商目录中有一个资产文件夹,其中有一个样式表文件夹。我假设rails检查了这些文件夹的引导,因为它们存在,而不是导入引导gem?一旦我删除了那些,它就工作得很好。

什么是“不工作”?您应该使用开发人员工具(如谷歌浏览器)来检查任何错误消息,并查看源代码,以查看是否存在Bootstrap的CSS。你试过提神吗?在使用标准rails服务器的开发过程中,资产将在一个页面上加载404。启动组件,如按钮、表格等…我已经多次尝试刷新它。我已经看过google chrome inspect element工具,我可以看到在网络选项卡下并没有加载所有资产,比如application.css,它导入了bootstrapWhat,特别是“不工作”?您应该使用开发人员工具(如谷歌浏览器)来检查任何错误消息,并查看源代码,以查看是否存在Bootstrap的CSS。你试过提神吗?在使用标准rails服务器的开发过程中,资产将在一个页面上加载404。启动组件,如按钮、表格等…我已经多次尝试刷新它。我看过google chrome inspect element工具,我可以看到在网络选项卡下没有加载所有资产,比如application.css,它导入引导程序,但它不起作用。我的意思是,当我设置一个按钮,从引导程序中获得一个类btn或一个表时,他们在一些页面上不使用twitter引导程序css,我不知道为什么其他页面的推特引导程序也能正常工作。我尝试过bundle exec rake assests:compile,但它们在我的开发环境中没有显示。在这些元素中,我根本看不到任何css加载,原因是什么?因为它在其他页面上运行良好。我说它不工作是指当我设置一个按钮,例如从引导中设置一个类btn或一个表时,它们在一些页面上不使用twitter引导css,我不确定为什么其他页面的推特引导工作正常。我尝试过bundle exec rake assests:compile,但它们在我的开发环境中没有显示。在这些元素中,我根本看不到任何css加载,原因是什么?因为它可以在其他页面上正常工作。
<p><%= notice %></p>

<p><%= @basket_items.product_totals %><p>

<%= button_to "Purchase products", new_payment_path, :class => "btn" %>

<table class="table table-hover">
 <tr>
  <th>Picture</th>
  <th>Name</th>
  <th>Price</th>
  <th></th>
</tr>
<tr>
  <% @basket_items.each do |item| %>
    <td><p>Nothingness</p></td>
    <td><p><%= item.product.name %></p></td>
    <td><p><%= item.product.price %></p></td>
    <td><%= button_to 'Remove', basket_item_path(item.id), :method => 'delete', :confirm    => 'Are you sure?', :class => "btn" %></td>
  <% end %>
 </tr>
</table>
<button type="button" class="close" data-dismiss="alert">&times;</button>
<p><%= flash[:notice] %></p>

<div class="search">
 <%= form_tag(search_path, method: "get", :class => "form-search") do %>
 <%= text_field_tag(:query, nil, :class => "input-medium search-query") %>
 <%= submit_tag("Search", :class => "btn") %>
<% end %>
</div>  

<div class="container-fluid">
<div class="row-fluid">
<% @cp.each do |p| %>
  <div class="product"> 
    <div class="product-image">
      <%= image_tag p.image %>
    </div>
    <p><%= p.price %></p>
    <p><%= link_to p.name, product_path(p.slug) %></p>
<% end %>
</div>
</div>
</div>
.product {
  display: inline-block;
 }

.product-image {
  width: 40px;
  height: 50px;
 }

.row-fluid {
margin-top: 300px;
 }

.search {
  margin: 100px 10px 0px 0px;
 }