Class: Iron::LocalesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Iron::LocalesController
- Defined in:
- app/controllers/iron/locales_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/iron/locales_controller.rb', line 17 def create @locale = Locale.new(locale_params) if @locale.save redirect_to locales_path, notice: "Locale was successfully created." else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
35 36 37 38 39 40 41 |
# File 'app/controllers/iron/locales_controller.rb', line 35 def destroy if @locale.destroy redirect_to locales_path, notice: "Locale was successfully destroyed.", status: :see_other else redirect_back fallback_location: locales_path, alert: @locale.errors..to_sentence, status: :see_other end end |
#edit ⇒ Object
14 15 |
# File 'app/controllers/iron/locales_controller.rb', line 14 def edit end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/iron/locales_controller.rb', line 6 def index @locales = Locale.all end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/iron/locales_controller.rb', line 10 def new @locale = Locale.new end |
#update ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/controllers/iron/locales_controller.rb', line 27 def update if @locale.update(locale_params) redirect_to locales_path, notice: "Locale was successfully updated.", status: :see_other else render :edit, status: :unprocessable_entity end end |