2012-01-24 20:16:53 +00:00
|
|
|
module Locomotive
|
|
|
|
module Api
|
|
|
|
class ContentTypesController < BaseController
|
|
|
|
|
|
|
|
def index
|
|
|
|
@content_types = current_site.content_types
|
|
|
|
respond_with(@content_types)
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
@content_type = current_site.content_types.create(params[:content_type])
|
2012-01-26 15:51:32 +00:00
|
|
|
respond_with @content_type, :location => main_app.locomotive_api_content_types_url
|
2012-01-24 20:16:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
@content_type = current_site.content_types.find(params[:id])
|
|
|
|
@content_type.update_attributes(params[:content_type])
|
2012-01-26 15:51:32 +00:00
|
|
|
respond_with @content_type, :location => main_app.locomotive_api_content_types_url
|
2012-01-24 20:16:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|