2011-10-30 23:02:41 +00:00
|
|
|
module Locomotive
|
2011-11-18 23:20:37 +00:00
|
|
|
class ContentAssetsController < BaseController
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2011-06-21 12:47:11 +00:00
|
|
|
respond_to :json, :only => [:index, :create, :destroy]
|
|
|
|
|
|
|
|
def index
|
2011-11-19 14:47:56 +00:00
|
|
|
@content_assets = current_site.content_assets
|
|
|
|
respond_with(@content_assets)
|
2010-05-12 00:16:39 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2011-06-21 12:47:11 +00:00
|
|
|
def create
|
2011-11-19 14:47:56 +00:00
|
|
|
@content_asset = current_site.content_assets.create(params[:content_asset])
|
|
|
|
puts @content_asset.errors.inspect
|
|
|
|
respond_with @content_asset
|
2011-06-21 12:47:11 +00:00
|
|
|
end
|
|
|
|
|
2011-11-19 14:47:56 +00:00
|
|
|
def destroy
|
|
|
|
@content_asset = current_site.content_assets.find(params[:id])
|
|
|
|
@content_asset.destroy
|
|
|
|
respond_with @content_asset
|
2011-06-21 12:47:11 +00:00
|
|
|
end
|
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
end
|
2011-11-19 14:47:56 +00:00
|
|
|
end
|