มี error แบบนี้คืออะไรครับ undefined method `belong_to' for TableFactor:Class

  • warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 1005 is not allowed to access /tmp owned by uid 0 in /var/www/sites/sugree/codenone.com/subdomains/www/html/includes/file.inc on line 190.
  • warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 1005 is not allowed to access /tmp owned by uid 0 in /var/www/sites/sugree/codenone.com/subdomains/www/html/includes/file.inc on line 190.

undefined method `belong_to' for TableFactor:Class
มันคืออะไร แล้วแก้ไขอย่างไรถ้าเป็นได้ขอความกรุณายกตัวอย่างให้ได้ไหมครับ

ขอบพระคุณอย่างสูงครับ่ท่านผู้รู้

taiko_gogo's picture

มันคือ belong_to มันไม่ถูก define อ่ะคับ
ถ้าผมเดาไม่ผิด คุณกำลังจะทำ relation ระหว่าง model ใช่มะคับ
belong_to มันต้องเป็น belongs_to แบบนี้เน้อ

>
class Listitem < ActiveRecord::Base	
  belongs_to :Box	
  has_many :Comment, :dependent=>:delete_all
end
</blockcode>

ขอบคุณครับ

ย้าย Codenone

ประกาศย้าย Codenone ไปใช้ Forum ของ Blognone แทนครับ ตามไปตั้งกระทู้ต่อได้ที่ Codenone Forum (รายละเอียดอ่านจากกระทู้ ย้าย Codenone ไปรวมกับ Blognone)

กระทู้เก่าๆ จะย้ายตามไปในภายหลัง ตอนนี้ปิดการโพสต์กระทู้ไว้ เหลือไว้เฉพาะอ้างอิงเท่านั้น