views:

202

answers:

1

This is probably a silly question, but 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.

A: 

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']
Luke Francl