Sha256: 2d1435dfeb9e4581d969ad9a9c8bd2250d5391b440dfe4fede1e80c75063af59

Contents?: true

Size: 840 Bytes

Versions: 22

Compression:

Stored size: 840 Bytes

Contents

class Ckeditor::AttachmentFilesController < Ckeditor::ApplicationController

  def index
    @attachments = Ckeditor.attachment_file_adapter.find_all(ckeditor_attachment_files_scope)
    @attachments = Ckeditor::Paginatable.new(@attachments).page(params[:page])

    respond_with(@attachments, :layout => @attachments.first_page?)
  end

  def create
    @attachment = Ckeditor.attachment_file_model.new
    respond_with_asset(@attachment)
  end

  def destroy
    @attachment.destroy
    respond_with(@attachment, :location => attachment_files_path)
  end

  protected

    def find_asset
      @attachment = Ckeditor.attachment_file_adapter.get!(params[:id])
    end

    def authorize_resource
      model = (@attachment || Ckeditor.attachment_file_model)
      @authorization_adapter.try(:authorize, params[:action], model)
    end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
glebtv-ckeditor-4.4.7.4 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.4.7.3 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.4.7.2 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.4.7.1 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.4.7 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.4.6 app/controllers/ckeditor/attachment_files_controller.rb
ckeditor-4.1.1 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.4.3.4 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.4.3.3 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.4.3.2 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.4.3.1 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.4.3.0 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.3.2.6 app/controllers/ckeditor/attachment_files_controller.rb
ckeditor-4.1.0 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.3.2.5 app/controllers/ckeditor/attachment_files_controller.rb
ckeditor-4.0.11 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.3.2.4 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.3.2.3 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.3.2.2 app/controllers/ckeditor/attachment_files_controller.rb
glebtv-ckeditor-4.3.2.1 app/controllers/ckeditor/attachment_files_controller.rb