Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.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
Ruby Spree:Deface获取错误名称Spree::Home#index中的错误_Ruby_Ruby On Rails 4_Spree - Fatal编程技术网

Ruby Spree:Deface获取错误名称Spree::Home#index中的错误

Ruby Spree:Deface获取错误名称Spree::Home#index中的错误,ruby,ruby-on-rails-4,spree,Ruby,Ruby On Rails 4,Spree,我试图改变首页上列出的项目的外观,但我得到了一个错误。我是否正确使用deface来更改它?它告诉我,给了我错误,如果我删除了,那么就没有图片了。我该怎么办 更新_products.rb Deface::Override.new(:virtual_path =>"spree/shared/_products", :name => "change site", :replace =>"#produc

我试图改变首页上列出的项目的外观,但我得到了一个错误。我是否正确使用deface来更改它?它告诉我,
给了我错误,如果我删除了,那么就没有图片了。我该怎么办

更新_products.rb

Deface::Override.new(:virtual_path =>"spree/shared/_products",
                     :name => "change site",
                     :replace =>"#products",
                     :text => '



<%
  paginated_products = @searcher.retrieve_products if params.key?(:keywords)
  paginated_products ||= products
%>

<% content_for :head do %>
  <% if paginated_products.respond_to?(:num_pages) %>
    <%= rel_next_prev_link_tags paginated_products %>
  <% end %>
<% end %>

<div data-hook="products_search_results_heading">
  <% if products.empty? %>
    <div data-hook="products_search_results_heading_no_results_found">
      <%= Spree.t(:no_products_found) %>
    </div>
  <% elsif params.key?(:keywords) %>
    <div data-hook="products_search_results_heading_results_found">
      <h6 class="search-results-title"><%= Spree.t(:search_results, keywords: h(params[:keywords])) %></h6>
    </div>
  <% end %>
</div>

<% if products.any? %>
  <div id="products" class="row" data-hook>
    <% products.each do |product| %>
      <% url = spree.product_url(product, taxon_id: @taxon.try(:id)) %>
      <div id="product_<%= product.id %>" class="col-md-3 col-sm-6 product-list-item" data-hook="products_list_item" itemscope itemtype="https://schema.org/Product">
        <div class="panel panel-default">
          <% cache(@taxon.present? ? [I18n.locale, current_currency, @taxon, product] : [I18n.locale, current_currency, product]) do %>
            <div class="panel-body text-center product-body">
              <br/>
<%= link_to small_image(product, itemprop: "image"), url, itemprop: 'url' %>
            </div>
            <div class="panel-footer text-center">
              <span itemprop="offers" itemscope itemtype="https://schema.org/Offer">
                <span class="price selling lead" itemprop="price"><%= display_price(product) %></span>
              </span>
            </div>
          <% end %>
        </div>
      </div>
    <% end %>
    <% reset_cycle("classes") %>
  </div>
<% end %>

<% if paginated_products.respond_to?(:num_pages) %>

<% end %>
')
Deface::Override.new(:virtual\u path=>“spree/shared/\u产品”,
:name=>“更改站点”,
:replace=>“#产品”,
:text=>'

')
url的一个小报价问题
检查以下代码:-

Deface::Override.new(:virtual_path =>"spree/shared/_products",
                     :name => "change site",
                     :replace =>"#products",
                     :text => '



<%
  paginated_products = @searcher.retrieve_products if params.key?(:keywords)
  paginated_products ||= products
%>

<% content_for :head do %>
  <% if paginated_products.respond_to?(:num_pages) %>
    <%= rel_next_prev_link_tags paginated_products %>
  <% end %>
<% end %>

<div data-hook="products_search_results_heading">
  <% if products.empty? %>
    <div data-hook="products_search_results_heading_no_results_found">
      <%= Spree.t(:no_products_found) %>
    </div>
  <% elsif params.key?(:keywords) %>
    <div data-hook="products_search_results_heading_results_found">
      <h6 class="search-results-title"><%= Spree.t(:search_results, keywords: h(params[:keywords])) %></h6>
    </div>
  <% end %>
</div>

<% if products.any? %>
  <div id="products" class="row" data-hook>
    <% products.each do |product| %>
      <% url = spree.product_url(product, taxon_id: @taxon.try(:id)) %>
      <div id="product_<%= product.id %>" class="col-md-3 col-sm-6 product-list-item" data-hook="products_list_item" itemscope itemtype="https://schema.org/Product">
        <div class="panel panel-default">
          <% cache(@taxon.present? ? [I18n.locale, current_currency, @taxon, product] : [I18n.locale, current_currency, product]) do %>
            <div class="panel-body text-center product-body">
              <br/>
<%= link_to small_image(product, itemprop: "image"), url, itemprop: "url" %>
            </div>
            <div class="panel-footer text-center">
              <span itemprop="offers" itemscope itemtype="https://schema.org/Offer">
                <span class="price selling lead" itemprop="price"><%= display_price(product) %></span>
              </span>
            </div>
          <% end %>
        </div>
      </div>
    <% end %>
    <% reset_cycle("classes") %>
  </div>
<% end %>

<% if paginated_products.respond_to?(:num_pages) %>

<% end %>
')
Deface::Override.new(:virtual\u path=>“spree/shared/\u产品”,
:name=>“更改站点”,
:replace=>“#产品”,
:text=>'

')