title: CarrierWave and Fog, S3 bucket and store_dir configuration
body: <p>I'm trying to figure out how to setup CarrierWave to work with Fog and Amazon S3. On S3, I have a bucket, "bucket1" with folder "images". Uploads work fine. For example, an image might get uploaded to something of the form <a href="https://s3.amazonaws.com/bucket1/images/picture/pic1.jpg">https://s3.amazonaws.com/bucket1/images/picture/pic1.jpg</a>. However, in the show view, when I call the image_url helper, I get <a href="https://s3.amazonaws.com/images/picture/pic1.jpg">https://s3.amazonaws.com/images/picture/pic1.jpg</a>. What am I missing here?</p>
  
  <pre><code>#config/initializers/carrierwave.rb
  CarrierWave.configure do |config|
    config.fog_credentials = {
      :provider               =&gt; 'AWS',
      :aws_access_key_id      =&gt; 'aws_key',
      :aws_secret_access_key  =&gt; 'aws_secret'
    }
    config.fog_directory  = 'bucket1'
    config.fog_host       = 'https://s3.amazonaws.com'
    config.fog_public     = true
    config.fog_attributes = {'Cache-Control'=&gt;'max-age=315576000'}
  end
  
  #app/uploader/image_uploader.rb
  def store_dir
    "images/#{model.class.to_s.underscore}"
  end
  
  #app/views/pictures/show.html.erb
  &lt;%= image_tag @picture.image_url if @picture.image? %&gt;
  </code></pre>