开发者

Form in Ruby on Rails

开发者 https://www.devze.com 2023-03-24 04:37 出处:网络
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 figu

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

精彩评论

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