开发者

getting global s3 bucket name while using paperclip in rails

This is probably a silly question, bu开发者_开发技巧t is there a way I can pull out the root bucket name out of the YML s3 file I have? Other tutorials I've seen just assume that the buckets are named development/test-(whatever). I just want to pull exactly what is in the amazon 3s yml out of there, or else I'll have to hard code it...

I've tried like S3_CONFIG['bucket_name'] but I think that may be attachment_fu specific, not sure.


Remember, you can always parse the YAML file yourself.

Probably something along these lines:

config = YAML.load_file(Rails.root.join('config', 'aws_s3.yml'))
bucket_name = config[Rails.env]['bucket_name']
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜