Sha256: 9c8191975e97777de1e598dad5c2e724e1e06cf485e228507653aa96e2f8eb24

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

module Locomotive
  module Api
    class ContentAssetsController < BaseController

      load_and_authorize_resource :class => Locomotive::ContentAsset

      def index
        @content_assets = current_site.content_assets
        respond_with(@content_assets)
      end

      def show
        @content_asset = current_site.content_assets.find(params[:id])
        respond_with(@content_asset)
      end

      def create
        @content_asset = current_site.content_assets.create(params[:content_asset])
        respond_with @content_asset, :location => main_app.locomotive_api_content_assets_url
      end

      def update
        @content_asset = current_site.content_assets.find(params[:id])
        @content_asset.update_attributes(params[:content_asset])
        respond_with @content_asset, :location => main_app.locomotive_api_content_assets_url
      end

      def destroy
        @content_asset = current_site.content_assets.find(params[:id])
        @content_asset.destroy
        respond_with @content_asset
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
locomotive_cms-2.0.0.rc12 app/controllers/locomotive/api/content_assets_controller.rb
locomotive_cms-2.0.0.rc11 app/controllers/locomotive/api/content_assets_controller.rb
locomotive_cms-2.0.0.rc10 app/controllers/locomotive/api/content_assets_controller.rb
locomotive_cms-2.0.0.rc9 app/controllers/locomotive/api/content_assets_controller.rb
locomotive_cms-2.0.0.rc8 app/controllers/locomotive/api/content_assets_controller.rb