Sha256: a3542936ccf71622efd1610224793d8a273df5c3f8dd201ae2ad3899b819c947

Contents?: true

Size: 958 Bytes

Versions: 17

Compression:

Stored size: 958 Bytes

Contents

class Cms::AssetsController < Cms::MainController
  authenticate_user :all

  def show
    @asset = @context.assets.find params[:id]
  end

  def new
    @asset = Cms::Asset.new
  end

  def create
    @asset = @context.assets.build params[:cms_asset]
    if @asset.save
      flash[:notice] = t('assets.flash.created')
      redirect_to cms_root_path
    else
      render :action => 'new'
    end
  end

  def edit
    @asset = @context.assets.find params[:id]
  end

  def update
    @asset = @context.assets.find params[:id]
    if @asset.update_attributes params[:cms_asset]
      flash[:notice] = t('assets.flash.updated')
      redirect_to cms_root_path
    else
      render :action => 'edit'
    end
  end

  def destroy
    @asset = @context.assets.find(params[:id])
    @asset.destroy

    flash[:notice] = t('assets.flash.deleted')
    
    respond_to do |format|
      format.html { redirect_to cms_root_path }
      format.js
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
liquid_cms-0.2.0.9 app/controllers/cms/assets_controller.rb
liquid_cms-0.3.0.7 app/controllers/cms/assets_controller.rb
liquid_cms-0.3.0.6 app/controllers/cms/assets_controller.rb
liquid_cms-0.2.0.8 app/controllers/cms/assets_controller.rb
liquid_cms-0.3.0.5 app/controllers/cms/assets_controller.rb
liquid_cms-0.2.0.7 app/controllers/cms/assets_controller.rb
liquid_cms-0.3.0.4 app/controllers/cms/assets_controller.rb
liquid_cms-0.2.0.6 app/controllers/cms/assets_controller.rb
liquid_cms-0.3.0.3 app/controllers/cms/assets_controller.rb
liquid_cms-0.2.0.5 app/controllers/cms/assets_controller.rb
liquid_cms-0.2.0.4 app/controllers/cms/assets_controller.rb
liquid_cms-0.3.0.2 app/controllers/cms/assets_controller.rb
liquid_cms-0.2.0.3 app/controllers/cms/assets_controller.rb
liquid_cms-0.2.0.2 app/controllers/cms/assets_controller.rb
liquid_cms-0.3.0.1 app/controllers/cms/assets_controller.rb
liquid_cms-0.3.0 app/controllers/cms/assets_controller.rb
liquid_cms-0.2.0 app/controllers/cms/assets_controller.rb