Class: Ckeditor::AttachmentFilesController

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

Instance Method Summary collapse

Instance Method Details

#createObject



13
14
15
16
# File 'app/controllers/ckeditor/attachment_files_controller.rb', line 13

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

#destroyObject



18
19
20
21
22
23
24
25
# File 'app/controllers/ckeditor/attachment_files_controller.rb', line 18

def destroy
  @attachment.destroy

  respond_to do |format|
    format.html { redirect_to attachment_files_path }
    format.json { render :nothing => true, :status => 204 }
  end
end

#indexObject



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

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

  respond_to do |format|
    format.html { render :layout => @attachments.first_page? }
  end
end