screenconcept/qbrick

View on GitHub
app/controllers/qbrick/cms/ckimages_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Qbrick
  module Cms
    class CkimagesController < BackendController
      layout 'qbrick/cms/ckimages'
      skip_before_action :verify_authenticity_token
      respond_to :html, :js

      def create
        @func_num = params['CKEditorFuncNum']
        @ck_editor = params['CKEditor']
        @ckimage = Qbrick::Ckimage.create(file: params[:upload])
      end

      def index
        @func_num = params['CKEditorFuncNum']
        @ck_editor = params['CKEditor']
        @ckimages = Qbrick::Ckimage.all
      end

      def destroy
        @ckimage = Qbrick::Ckimage.find(params[:id])
        @ckimage.destroy
      end
    end
  end
end