Sha256: 459045f5eb012c31bce3624a719b4f29ec0a411b5fc5e141b3dbaf3d05bacc8a

Contents?: true

Size: 752 Bytes

Versions: 22

Compression:

Stored size: 752 Bytes

Contents

class Ckeditor::PicturesController < Ckeditor::ApplicationController

  def index
    @pictures = Ckeditor.picture_adapter.find_all(ckeditor_pictures_scope)
    @pictures = Ckeditor::Paginatable.new(@pictures).page(params[:page])

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

  def create
    @picture = Ckeditor.picture_model.new
    respond_with_asset(@picture)
  end

  def destroy
    @picture.destroy
    respond_with(@picture, :location => pictures_path)
  end

  protected

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

    def authorize_resource
      model = (@picture || Ckeditor.picture_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/pictures_controller.rb
glebtv-ckeditor-4.4.7.3 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.4.7.2 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.4.7.1 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.4.7 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.4.6 app/controllers/ckeditor/pictures_controller.rb
ckeditor-4.1.1 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.4.3.4 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.4.3.3 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.4.3.2 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.4.3.1 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.4.3.0 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.3.2.6 app/controllers/ckeditor/pictures_controller.rb
ckeditor-4.1.0 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.3.2.5 app/controllers/ckeditor/pictures_controller.rb
ckeditor-4.0.11 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.3.2.4 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.3.2.3 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.3.2.2 app/controllers/ckeditor/pictures_controller.rb
glebtv-ckeditor-4.3.2.1 app/controllers/ckeditor/pictures_controller.rb