-3

我是 ror 新手,我遇到了一个错误

class Item < ActiveRecord::Base
  attr_accessible :latitude, :longitude, :photos, :price, :title, :user_id, :category_id
  attr_accessor :user_id, :category_id
  belongs_to :user
  belongs_to :catgory
  reverse_geocoded_by :latitude, :longitude
  after_validation :reverse_geocode
end

调用栈是:

ActionController::RoutingError (undefined method `belings_to' for #<Class:0x00000003b1c418>):
app/models/item.rb:5:in `<class:Item>'
app/models/item.rb:1:in `<top (required)>'
app/controllers/item_controller.rb:1:in `<top (required)>'
4

1 回答 1

3

ActionController::RoutingError (undefined method `belings_to'

应该是belongs_to,检查你的代码

于 2013-04-18T19:08:43.020 回答