Sha256: cb79a429cb72ad8e8bd9602146d9776e8b58cf16e4553fd3f1ebec01ab217f1a

Contents?: true

Size: 792 Bytes

Versions: 6

Compression:

Stored size: 792 Bytes

Contents

module Admin

  class ImageUploadController < BaseController

    def upload_image
      @image = params[:image_class].camelize.constantize.new
      @image.send("#{params[:field]}=", params[:image])
      @image.valid?
      @free_size = params[:free_size] || false

      @errors = @image.errors[params[:field].to_sym]
      if @errors.blank?
        @preview_url = if params[:version].present?
                         @image.send("#{params[:field]}_url", params[:version].to_sym)
                       else
                         @image.send("#{params[:field]}_url")
                       end
        @image_cache = @image.send("#{params[:field]}_cache")
        render '/admin/common/upload_image'
      else
        render '/admin/common/upload_failed'
      end
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
coalla-cms-0.7.0.0 app/controllers/admin/image_upload_controller.rb
coalla-cms-0.5.2.4 app/controllers/admin/image_upload_controller.rb
coalla-cms-0.6.1.1 app/controllers/admin/image_upload_controller.rb
coalla-cms-0.6.0.9 app/controllers/admin/image_upload_controller.rb
coalla-cms-0.5.1.9 app/controllers/admin/image_upload_controller.rb
coalla-cms-0.5.1.8 app/controllers/admin/image_upload_controller.rb