title: Rails Paperclip::AdapterRegistry::NoHandlerError
body: <h3>Error</h3>
  
  <pre><code>Paperclip::AdapterRegistry::NoHandlerError at /admin/posts/1 No handler found for foo.png
  </code></pre>
  
  <p>I have a rails 4 app with Active Admin and im trying to upload an image to my Post model but I am getting the above error. Here is my setup</p>
  
  <h3>Gemfile</h3>
  
  <pre><code>ruby '2.1.2'
  
  gem 'rails', '4.1.6'
  gem 'activeadmin', github: 'gregbell/active_admin'
  gem 'paperclip'
  gem 'aws-sdk'
  </code></pre>
  
  <h3>Model</h3>
  
  <pre><code>class Post &lt; ActiveRecord::Base
  
    has_attached_file :image, styles: {
      thumb: '100x100&gt;',
      square: '200x200#',
      medium: '300x300&gt;'
    }
    validates_attachment_content_type :image, :content_type =&gt; /\Aimage\/.*\Z/
  
  end
  </code></pre>
  
  <h3>Active Admin</h3>
  
  <pre><code>permit_params :image
  
  form do |f|
    f.inputs do
      f.input :image, as: :file, hint: (f.template.image_tag(f.object.image.url(:thumb)) if f.object.image?)
    end
    f.actions
  end
  </code></pre>
  
  <h3>/config/initializers/paperclip.rb</h3>
  
  <pre><code>Paperclip::Attachment.default_options[:storage] = :s3
  Paperclip::Attachment.default_options[:s3_host_name] = 's3-eu-west-1.amazonaws.com'
  Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
  Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
  Paperclip::Attachment.default_options[:s3_protocol] = 'http'
  Paperclip::Attachment.default_options[:s3_credentials] = 
    { :bucket =&gt; 'foo-production',
      :access_key_id =&gt; 'XXXXXXXXXXXX',
      :secret_access_key =&gt; 'XXXXXXXXXXXXXXXXXXXXXX' }
  </code></pre>