0

基本的に販売する製品のリストである、与えられたテンプレートを適応させることで、私は自分の道を進んでいます. トップダウン リストからテーブル レイアウトに変更したい。私は次のように何かを終わらせたいです-

<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>

これは、私が達成しようとしているレイアウトではうまく機能します。私が抱えている問題は、コードの <% other parts go here %> 部分を貼り付けたときです。ページに内部エラー メッセージが表示されます。私はRubyにまったく慣れていないので、これを本当にうまくやっていないだけです。おそらく非常に単純なことを無視しているという予感があります。コードは次の<% other parts go here %>とおりです。

<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 %>

私が間違っていること、欠けていること、または変更に失敗していることを誰かが指摘できる場合は、大いに感謝します! よろしくお願いします。ナイジェル

4

1 に答える 1

0

endあなたの他の部分には比類のないものがあるようですi = i + 1

于 2010-05-29T20:11:18.987 に答える