Sha256: e1c35b6b0898d89a3516e5cf09176c64b4fe9cf36a00c2c90c3b5ac89ee943f9

Contents?: true

Size: 732 Bytes

Versions: 8

Compression:

Stored size: 732 Bytes

Contents

Sinatra
=======
You can use {Dragonfly::Job Job}'s `to_response` method like so:

    app = Dragonfly[:images].configure_with(:imagemagick)

    get '/images/:size.:format' do |size, format|
      app.fetch_file('~/some/image.png').thumb(size).encode(format).to_response(env)
    end

`to_response` returns a rack-style response array with status, headers and body.

NOTE: uids from the datastore currently have slashes and dots in them so may cause problems when using ':uid' as
a path segment.

or you can mount as a middleware, like in rails:

    Dragonfly[:images].configure_with(:imagemagick) do |c|
      c.url_path_prefix = '/media'
    end

    use Dragonfly::Middleware, :images, '/media'

    get '/' #... do
      # ...

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
dragonfly-0.8.6 extra_docs/Sinatra.md
dragonfly-0.8.5 extra_docs/Sinatra.md
dragonfly-0.8.4 extra_docs/Sinatra.md
fog-dragonfly-0.8.2 extra_docs/Sinatra.md
dragonfly-0.8.2 extra_docs/Sinatra.md
fog-dragonfly-0.8.1 extra_docs/Sinatra.md
dragonfly-0.8.1 extra_docs/Sinatra.md
dragonfly-0.8.0 extra_docs/Sinatra.md