Sha256: 56f2c98e3ebd8ce9a742d7919dc596e4c4194fe525e28a5b86b3e665566446f6

Contents?: true

Size: 957 Bytes

Versions: 4

Compression:

Stored size: 957 Bytes

Contents

require 'dragonfly'
require 'rack/cache'

### The dragonfly app ###

app = Dragonfly::App[:images]
app.configure_with(Dragonfly::RMagickConfiguration)
app.configure do |c|
  c.log = RAILS_DEFAULT_LOGGER
  c.datastore.configure do |d|
    d.root_path = "#{Rails.root}/public/system/dragonfly/#{Rails.env}"
  end
  c.url_handler.configure do |u|
    u.protect_from_dos_attacks = false
    u.path_prefix = '/media'
  end
end

### Extend active record ###
ActiveRecord::Base.extend Dragonfly::ActiveRecordExtensions
ActiveRecord::Base.register_dragonfly_app(:image, app)

### Insert the middleware ###
ActionController::Dispatcher.middleware.insert_after ActionController::Failsafe, Dragonfly::Middleware, :images
ActionController::Dispatcher.middleware.insert_before Dragonfly::Middleware, Rack::Cache, {
  :verbose     => true,
  :metastore   => "file:#{Rails.root}/tmp/dragonfly/cache/meta",
  :entitystore => "file:#{Rails.root}/tmp/dragonfly/cache/body"
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dragonfly-0.4.4 lib/dragonfly/rails/images.rb
dragonfly-0.4.3 lib/dragonfly/rails/images.rb
dragonfly-0.4.2 lib/dragonfly/rails/images.rb
dragonfly-0.4.1 lib/dragonfly/rails/images.rb