Sha256: 0c23e24b7b6f65e564feb0d732907c97b12f75dfe7b732ea4b6ddb973e58e749

Contents?: true

Size: 575 Bytes

Versions: 2

Compression:

Stored size: 575 Bytes

Contents

class CmsAdmin::UploadsController < CmsAdmin::BaseController
  before_filter :load_cms_upload,
    :only => :destroy
  
  def index
  end
  
  def create
    @cms_upload = CmsUpload.new(:uploaded_file => params[:file])
    if @cms_upload.save
      render(:partial => 'cms_admin/uploads/upload', :object => @cms_upload)
    else
      render :nothing => true
    end
  end
  
  def destroy
    @cms_upload.destroy
  end

protected
  def load_cms_upload
    @cms_upload = CmsUpload.find(params[:id])
  rescue ActiveRecord::RecordNotFound
    render :nothing => true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.0.1 app/controllers/cms_admin/uploads_controller.rb
comfortable_mexican_sofa-1.0.0 app/controllers/cms_admin/uploads_controller.rb