Displaying 1 result from an estimated 1 matches for "pick_your_own".
2006 Aug 17
6
Rails and Checkboxes
...age which lets the user make
a pizza by setting check boxes. The choose their toppings, click submit
and the form does a callback and shows them how much it will cost to
have a pizza with those toppings on.
At the moment I have the following:
View:
<%= start_form_tag :action => "pick_your_own" %>
Anchovies
<%= check_box "pizza", "anchovies" %>
<% end_form_tag %>
Controller:
@total = 0
if @pizza.anchovies? > 0 then
@total = @total + 10
end
This gives me a NoMethodError with "You have a nil object when ou didn''t
expe...