RoR初心者はこちら。Railsを使用したアジャイルWeb開発の最後の第9章で、「プレイタイム」の演習を行います。link_to_remoteを取得して、部分的にリンクを生成することができません。私のstore_cart_item.html.erbの部分は次のようになります。
<% if cart_item == @current_item then %>
<tr id="current_item">
<% else %>
<tr>
<% end %>
<td>
<!-- stuck here, trying to get a link to decrement the quantity, but it doesn't
even show a link, I also tried nesting a link_to in form_remote_tag which
at least displayed link but didn't call the remove_from_cart action -->
<% link_to_remote cart_item.quantity.to_s + "×",
:update => "cart",
:url => {:action => "remove_from_cart", :id => cart_item.product} %>
</td>
<td><%= h cart_item.title %></td>
<td class="item-price"><%= number_to_currency(cart_item.price) %></td>
</tr>
ブラウザでは、link_to_remoteは何もしていないように見えますが、b /chtml出力は次のようになります。
<tr>
<td>
<!-- stuck here, trying to get a stupid link to decrement the quantity, doesn't even show link
also tried nesting it in form_remote_tag which at least displayed link but didn't call the
remove_from_cart action -->
</td>
<td>Agile Web Development with Rails</td>
<td class="item-price">$68.85</td>
</tr>
本当に明らかな何かが欠けているような気がします。私は何が間違っているのですか?