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 erb模板-尝试更改布局-获取错误_Ruby_List_Erb_Product_Tablelayout - Fatal编程技术网

Ruby erb模板-尝试更改布局-获取错误

Ruby erb模板-尝试更改布局-获取错误,ruby,list,erb,product,tablelayout,Ruby,List,Erb,Product,Tablelayout,我正在努力调整一个模板,这个模板基本上是一个待售产品列表。我想将它从自上而下的列表更改为表格布局。 我想以下面的内容结束- <div id= 'ladiesproducts'> <% ladies_products = hosting_products.find_all do |product| product.name.match("ladies") end %> <table><tbody> <% [ladies_products].ea

我正在努力调整一个模板,这个模板基本上是一个待售产品列表。我想将它从自上而下的列表更改为表格布局。 我想以下面的内容结束-

<div id= 'ladiesproducts'>
<% ladies_products = hosting_products.find_all do
|product|
product.name.match("ladies")
end %>
<table><tbody>
<% [ladies_products].each do | slice | %>
<tr>
<% slice.each do | product | %>
<td>
<h4><%= product.name.html %></h4>
<p><%= product.description %></p>
<% other parts go here %>
</td>
<% end %>
</tr>
<% end %>
</tbody></table>
</div>
这对于我正在尝试实现的布局非常有效。 我遇到的问题是当我粘贴回代码的一部分时。 我在页面上收到一条内部错误消息。 我对Ruby完全是新手,所以我只是在这个问题上笨手笨脚的。我有一种预感,我忽略了一些可能非常简单的事情。 代码如下:

<input type='hidden' name='base_renewal_period-<%= i %>' value="<%= 
product.base_renewal_period %>" />
<input type='hidden' name='quoted_unit_price-<%= i %>' value="<%=         billing.price(product.unit_price) 
%>" />
<p><input type='radio' name='add-product' value='<%= product.specific_type.html %>:<%= i 
%>:base_renewal_period,quoted_unit_price,domain' /><%= billing.currency_symbol.html %><%= 
billing.price(product.unit_price, :use_tax_prefs) %>
<% if product.base_renewal_period != 'never' %>
every <%= product.unit_period.to_s_short.html %>
<% end %>
<% if product.setup_fee != 0 %>
plus a one off fee of <%= billing.currency_symbol.html %><%= sprintf("%.2f", if billing.include_tax? 
then billing.price(product.setup_fee) else product.setup_fee end) %>
<% end %>
<% if product.has_free_products? %>
<br />
includes free domains 
<% product.free_products_list.each do | free_product | %>
<%= free_product["free_name"] %>
<% end %>
<% end %>
*
</p>
<% i = i + 1 %>
<% end %>
<p><input type='submit' value='Add to Basket'/></p>
</form>
<% unless basket.nil? or basket.empty? or no_upsell? %>
<p><a href='basket?add-no-product=package'>No thank you, please continue with my order 
...</a></p>
<% end %>
<% if not billing.tax_applies? %>
<% elsif billing.include_tax? %>
<p>* Includes <%= billing.tax_name %></p>
<% else %>
<p>* Excluding <%= billing.tax_name %></p>
<% end %>
如果有人能指出我做错了什么,我错过了什么,或者没有改变什么,我将不胜感激! 非常感谢。
奈杰尔

看来你在i=i+1周围的另一部分有一个无与伦比的结局。

非常感谢-整理好了。干杯,你是个传奇人物!