Sha256: 7bc5b0ace8bac8f48866c9542a2bb2b1325506c638087059753735b557fabeed

Contents?: true

Size: 725 Bytes

Versions: 3

Compression:

Stored size: 725 Bytes

Contents

class Admin::ImagesController < Admin::ResourceController
  
  before_filter :index_assets,          :only => [ :index ]
  before_filter :edit_assets,           :only => [ :show, :edit ]
  around_filter :rescue_s3_exceptions,  :only => [ :create, :update, :destroy ]
  
  def index
    @images = Image.paginate :page => params[:page], :per_page => params[:pp] || 25
  end
  
  protected

  def index_assets
    include_stylesheet 'admin/extensions/images/index'
  end
  
  def edit_assets
    include_stylesheet 'admin/extensions/images/edit'
  end
  
  def rescue_s3_exceptions
    begin
      yield
    rescue AWS::S3::ResponseError => e
      flash[:error] = e.to_s
      redirect_to admin_images_url
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
radiant-images-extension-0.4.1 app/controllers/admin/images_controller.rb
radiant-images-extension-0.4.0 app/controllers/admin/images_controller.rb
radiant-images-extension-0.3.4 app/controllers/admin/images_controller.rb