Sha256: 9fda42ceaea222f8332ffff830300b0d63f09ff4f253ebedfd6ccaf37ff3c9ef

Contents?: true

Size: 1.03 KB

Versions: 39

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module Alchemy
  module Admin
    class EssencePicturesController < Alchemy::Admin::BaseController
      include CropAction

      authorize_resource class: Alchemy::EssencePicture

      before_action :load_essence_picture, only: [:edit, :update]
      before_action :load_content, only: [:edit, :update]

      helper "alchemy/admin/contents"
      helper "alchemy/admin/essences"
      helper "alchemy/url"

      def edit
      end

      def update
        @essence_picture.update(essence_picture_params)
      end

      private

      def load_essence_picture
        @essence_picture = EssencePicture.find(params[:id])
      end

      def load_croppable_resource
        @croppable_resource = EssencePicture.find(params[:id])
      end

      def load_content
        @content = Content.find(params[:content_id])
      end

      def essence_picture_params
        params.require(:essence_picture).permit(:alt_tag, :caption, :css_class, :render_size, :title, :crop_from, :crop_size)
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
alchemy_cms-6.1.10 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.1.9 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.1.8 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.1.7 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.1.6 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.1.5 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.0.14 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.1.4 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.0.13 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.1.3 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.1.2 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.1.1 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.1.0 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.0.12 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.0.11 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.0.10 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.0.9 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.0.8 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.0.7 app/controllers/alchemy/admin/essence_pictures_controller.rb
alchemy_cms-6.0.6 app/controllers/alchemy/admin/essence_pictures_controller.rb