开发者

Form in Ruby on Rails

I can't sort out the forms. I'm going along with tutor开发者_StackOverflowial (Agile Web Development with Rails) and I'm trying to simply add the field Quantity to my line_items table. Can't figure this out. Please help. How can I change button_to to pass extra value?

<% if notice %>

<p id="notice" ><%= notice %></p>
<% end %>
<h1>Your Pragmatic Catalog</h1>
<% @products.each do |product| %>
<div class="entry" >
<%= image_tag(product.image_url) %>
<h3><%= product.title %></h3>
<%=sanitize product.description %>
<div class="price_line" >
<span class="price" ></span>
<%= button_to 'Add to Cart', line_items_path(:product_id => product) %>
</div>
</div>

<% end %>


Could you do something like:

<%= button_to 'Add to Cart', { :action => "delete", :id => @image.id, :locals => {:quantity => quantity} } %>

?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜