2010-10-09 56 views
3

刚开始学习如何使用paper_clip。我根据安装说明一切,并尝试上传的图像(profile_pic)...Rails 3 - 通过paper_clip了解attr_accessible

我,我不能大规模分配profile_pic错误...

,所以我说attr_accessible:profile_pic

并且停止了那个错误。我很好奇的是我的用户表中没有'profile_pic'列。相反,由于paper_clip,我有: t.string “profile_pic_file_name” t.string “profile_pic_content_type” t.integer “profile_pic_file_size” t.datetime “profile_pic_updated_at”

所以在我的努力去理解轨道,如何这是否解决了这个问题?设置模型attr_accessible:profile_pic是否可以作为图片之后的所有内容的通配符,还是这种类型的paper_clip魔术?

感谢

回答

1

这是因为profile_pic访问是定义设置你列。所以需要通过mass_upload访问来定义其他列。