small medium large xlarge

Generic-user-small
03 Apr 2008, 11:24
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 #

Extracted source (around line #20):

17: </p> 18: <p> 19: Pay with: 20: <%= form.select :pay_type, 21: Order::PAYMENT_TYPES, 22: :prompt => “Select a payment method” %> 23: </p>

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
16 May 2008, 14:46
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

You must be logged in to comment