Class: Iron::Api::Schema::ContentTypesController
- Inherits:
-
BaseController
- Object
- ActionController::API
- BaseController
- BaseController
- Iron::Api::Schema::ContentTypesController
- Defined in:
- app/controllers/iron/api/schema/content_types_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/iron/api/schema/content_types_controller.rb', line 15 def create @content_type = ContentType.new(content_type_params.merge(type: classified_type)) if @content_type.save render :show, status: :created, location: api_schema_content_type_url(@content_type) else render json: @content_type.errors, status: :unprocessable_entity end end |
#destroy ⇒ Object
33 34 35 36 |
# File 'app/controllers/iron/api/schema/content_types_controller.rb', line 33 def destroy @content_type.destroy! head :no_content end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/iron/api/schema/content_types_controller.rb', line 8 def index @content_types = ContentType.order(:name) end |
#show ⇒ Object
12 13 |
# File 'app/controllers/iron/api/schema/content_types_controller.rb', line 12 def show end |
#update ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/controllers/iron/api/schema/content_types_controller.rb', line 25 def update if @content_type.update(content_type_params) render :show else render json: @content_type.errors, status: :unprocessable_entity end end |