lib/carrierwave/jcrop/helpers.rb
# Form helper to render the preview of a cropped attachment.
# Loads the actual image. Previewbox has no constraints on dimensions, image is renedred at full size.
# By default box size is 100x100. Size can be customized by setting the :width and :height option.
# If you override one of width/height you must override both.
# By default original image is rendered. Specific version can be specified by passing version option
#
#   previewbox :avatar
#   previewbox :avatar, width: 200, height: 200
#   previewbox :avatar, version: :medium
#
# @param attachment [Symbol] attachment name
# @param opts [Hash] specify version or width and height options
Form helper to render the preview of a cropped attachment.
Loads the actual image. Previewbox has no constraints on dimensions, image is renedred at full size.
By default box size is 100x100. Size can be customized by setting the :width and :height option.
If you override one of width/height you must override both.
By default original image is rendered. Specific version can be specified by passing version option


Form helper to render the preview of a cropped attachment . Loads the actual image . Previewbox has no constraints on dimensions image is renedred at full size . By default box size is 100x100 . Size can be customized by setting the : width and : height option . If you override one of width / height you must override both . By default original image is rendered . Specific version can be specified by passing version option
def coordinates_set?(attachment,object)
        if object.respond_to?("#{attachment}_crop_params") && !object.send("#{attachment}_crop_params").nil?
          %w(crop_x crop_y crop_w crop_h).each do |p|
            return false unless object.send("#{attachment}_crop_params").has_key?(p)
          end
          true
        else
          false
        end
      end
def coordinates_set? ( attachment , object ) if object . respond_to? ( "#{attachment}_crop_params" ) && ! object . send ( "#{attachment}_crop_params" ) . nil? %w( crop_x crop_y crop_w crop_h ) . each do | p | return false unless object . send ( "#{attachment}_crop_params" ) . has_key? ( p ) end true else false end end
Form helper to render the preview of a cropped attachment.
Form helper to render the preview of a cropped attachment .
attachment
None
object
opts
specify version or width and height options
specify version or width and height options