Sha256: 609094b99bd28e58dfc6ce131a542a3f25d3cbb25e73f596eee30341b884aaf7

Contents?: true

Size: 521 Bytes

Versions: 1

Compression:

Stored size: 521 Bytes

Contents

module RailsUploads
  class PresetsController < ApplicationController

    def generate
      filename = "#{params[:image]}.#{params[:format]}"
      preset = params[:preset].gsub('-', '_').to_sym
      if ::File.exists?(Rails.root.join('public', 'uploads', 'images', 'original', filename)) and Rails.application.config.uploads.presets.has_key?(preset)
        RailsUploads::Types::Image.new(filename).send :generate_preset, preset
        redirect_to request.url, :cb => Random.rand(100000)
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_uploads-0.1.4 app/controllers/rails_uploads/presets_controller.rb