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']
精彩评论