Railsの考え方になかなか慣れない
The list of possible payment types is currently stored as a constant in the
Order class. Can you move this list into a database table? Can you still
make validation work for the field?
この問題解こうとして、
DBにPaymentTypeいれて
こうしてみたけど、どうやらArrayかhashしか受け入れて
くれないみたい。イテレーターでごぎょごぎょまわして
オブジェクトからArrayつくるのかな。なんかRubyらしい
やり方あったけ。さっぱりだ。Rubyの本買っとけばよかった。
<p> <label for="order_pay_type">Pay with:</label> <%= form.select :pay_type, PaymentType.find(:all), :prompt => "Select a payment method" %> </p>
ていうかこんなのMVC無視しまくりだし
動くわけないか。Serializeって方法があるぽいから
後で試してみよう