开发者

Paperclip directory pluralization problem

I've had a system thats been running fine for ages using Rails 3 & Paperclip 2.3.6 for members images.

class Image < ActiveRecord::Base
   belongs_to :business
   has_attached_f开发者_如何学运维ile :data, :styles => {:normal => ["665x443#", :jpg],:thumb => ["104x50#", :jpg]}, :convert_options => {:all => "-channel RGB -strip -quality 80"}
end

Now for some reason the route for the images has changed to /system/data/ instead of previous /system/datas/

I cant figure out whats happened. All of the images still reside in /system/datas/ and a member uploaded some new images and Paperclip has put them in /system/data/

Anyone have any ideas whats happened? I cant figure it out. Thanks.

EDIT: Ok, I had a test box still on Rails 3.0.3. My Release version was on 3.0.7. If I roll back to Rails 3.0.3 it's working again - the path /system/data/ becomes /system/datas/ again.


Rails 3.0.5 introduced some additional inflections which meant 'datas' was no longer used as the plural of 'data', which broke the directory naming for Paperclip!


According to the paperclip documentation you can specify a path for saving images in your model using the :path option and providing a path.

You can find the documentation here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜