Generic-user-small McKracken 1 post

Hello to all! I’ve a problem with the form.select helper in Iteration E1:

<%= form.select  :pay_type,
                    Order::PAYMENT_TYPES,
                    :prompt => "Select a payment method" %>

When i run it, it shows this error message:

undefined method `pay_type’ for #<order:0x34c6c6c>

Extracted source (around line #20):

17:


18:


19: <label for="order_pay_type">Pay with:</label>
20: <%= form.select :pay_type,
21: Order::PAYMENT_TYPES,
22: :prompt => “Select a payment method” %>
23:

This let me think that i’ve to define something in the Order model, but following the book this isn’t so…where’s the problem?
Thank you

 
Generic-user-small Fabrice Touzain 1 post

Hello,

I had the same error message.
This was only a typo error in 00?_create_orders.rb migration file for the database (I typed pya_type instead of pay_type).
(see at AWDwRoR 2nd Ed. on page 131 (printed version) for more details about this migration file)
I hope you did the same.

Fabrice

2 posts, 2 voices