class Ckeditor::PicturesController

def authorize_resource

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

def create

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

def destroy

def destroy
  @picture.destroy
  respond_to do |format|
    format.html { redirect_to pictures_path }
    format.json { render json: @picture, status: 204 }
  end
end

def find_asset

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

def index

def index
  @pictures = Ckeditor.picture_adapter.find_all(ckeditor_pictures_scope)
  @pictures = Ckeditor::Paginatable.new(@pictures).page(params[:page])
  respond_to do |format|
    format.html { render layout: @pictures.first_page? }
  end
end