Module: Alchemy::Admin::CropAction

Extended by:
ActiveSupport::Concern
Included in:
IngredientsController
Defined in:
app/controllers/concerns/alchemy/admin/crop_action.rb

Instance Method Summary collapse

Instance Method Details

#cropObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/concerns/alchemy/admin/crop_action.rb', line 12

def crop
  @picture = Alchemy::Picture.find_by(id: params[:picture_id])
  if @picture
    @croppable_resource.picture = @picture
    @settings = @croppable_resource.image_cropper_settings
    @element = @croppable_resource.element
  else
    @no_image_notice = Alchemy.t(:no_image_for_cropper_found)
  end

  render template: "alchemy/admin/crop"
end