阅读背景:

如何解决二级深层模型上传图像时的错误

来源:互联网 

Models in my app

class Category < ActiveRecord::Base
  has_many :dishes, :dependent => :destroy
end

class Dish < ActiveRecord::Base
  attr_accessible :assets_attributes
  belongs_to :category
  has_many :assets
  accepts_nested_attributes_for :assets, :allow_destroy => true
end

class Asset < ActiveRecord::Base
  belongs_to :dish
  has_attached_file :asset, :styles => { :large => "640x480", :medium => "300x300>", :thumb => "100x100>" }
end
class Category < ActiveRecor



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: