Class: Iron::Api::Schema::LocalesController
- Inherits:
-
BaseController
- Object
- ActionController::API
- BaseController
- BaseController
- Iron::Api::Schema::LocalesController
- Defined in:
- app/controllers/iron/api/schema/locales_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/iron/api/schema/locales_controller.rb', line 14 def create @locale = Locale.new(locale_params) if @locale.save render :show, status: :created, location: api_schema_locale_url(@locale) else render json: @locale.errors, status: :unprocessable_entity end end |
#destroy ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/controllers/iron/api/schema/locales_controller.rb', line 32 def destroy if @locale.destroy head :no_content else render json: @locale.errors, status: :unprocessable_entity end end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/iron/api/schema/locales_controller.rb', line 7 def index @locales = Locale.order(:code) end |
#show ⇒ Object
11 12 |
# File 'app/controllers/iron/api/schema/locales_controller.rb', line 11 def show end |
#update ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/controllers/iron/api/schema/locales_controller.rb', line 24 def update if @locale.update(locale_params) render :show else render json: @locale.errors, status: :unprocessable_entity end end |