Rails 不知道这里是否有通过使用 carrierwave 在动态表单中上传附件的经验!

kai209209 · March 20, 2014 · 1696 hits

看了 Railscasts 里面的 403 Dynamic Forms 这个视频,这个 product 中的 properties 字段能根据 product_type 设置的字段类型动态地将 product 数据整成 hash 一块塞进 properties 里面,感觉挺有用的,所以在最近的项目中也尝试用了这种方法,但是现在遇到了一个问题,就是 product_type 如果设置了一个 file_field 的字段,我希望在创建 product 用这个 file_field 字段上传属于 product 的附件(比如图片,现在使用的是 carrierwave),请问有大神有实现过这方面的经验吗?如果有的话,不知道你们的代码是怎么写的呢?

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.