I have just added qty to a product page.

I think I need to somehow put the button_to into the form, but it's working 
ok now.  

I'd like to pass in an instant variable @remaining into the max form 
element instead of using a fixed value there now (5).

I think I tried max = "<% @remaining %>", but that didn't work.  Not sure 
how that is passed into a form element.

<form>
  Quantity:
  <input type="number" name="quantity" value="1" min="1" max= "5" ><br>

</form>
<%= button_to "Add to Cart", { :controller => "products", :action => 
"add_to_cart", product_id: @product } %>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/1bac03f4-02c6-496f-a8dd-59abe52bd911%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to