Sha256: 1dada5897be1a6b33b5da4ec854e5976db70b5ec401a313c72745363bbf00388

Contents?: true

Size: 604 Bytes

Versions: 9

Compression:

Stored size: 604 Bytes

Contents

class CmsAdmin::UploadsController < CmsAdmin::BaseController
  
  skip_before_filter :load_fixtures
  
  before_filter :load_upload, :only => :destroy
  
  def index
    render
  end
  
  def create
    @upload = @site.uploads.create!(:file => params[:file])
    render :partial => 'file', :object => @upload
  rescue ActiveRecord::RecordInvalid
    render :nothing => true, :status => :bad_request
  end
  
  def destroy
    @upload.destroy
  end
  
protected
  
  def load_upload
    @upload = @site.uploads.find(params[:id])
  rescue ActiveRecord::RecordNotFound
    render :nothing => true
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.3.8 app/controllers/cms_admin/uploads_controller.rb
comfortable_mexican_sofa-1.3.7 app/controllers/cms_admin/uploads_controller.rb
comfortable_mexican_sofa-1.3.6 app/controllers/cms_admin/uploads_controller.rb
comfortable_mexican_sofa-1.3.5 app/controllers/cms_admin/uploads_controller.rb
comfortable_mexican_sofa-1.3.4 app/controllers/cms_admin/uploads_controller.rb
comfortable_mexican_sofa-1.3.3 app/controllers/cms_admin/uploads_controller.rb
comfortable_mexican_sofa-1.3.2 app/controllers/cms_admin/uploads_controller.rb
comfortable_mexican_sofa-1.3.1 app/controllers/cms_admin/uploads_controller.rb
comfortable_mexican_sofa-1.3.0 app/controllers/cms_admin/uploads_controller.rb