Class: Ckeditor::AttachmentFilesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ckeditor/attachment_files_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
# File 'app/controllers/ckeditor/attachment_files_controller.rb', line 10

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

#destroyObject



15
16
17
18
# File 'app/controllers/ckeditor/attachment_files_controller.rb', line 15

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

#indexObject



3
4
5
6
7
8
# File 'app/controllers/ckeditor/attachment_files_controller.rb', line 3

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