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
18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/iron/locales_controller.rb', line 18 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
36 37 38 39 40 41 42 |
# File 'app/controllers/iron/locales_controller.rb', line 36 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
15 16 |
# File 'app/controllers/iron/locales_controller.rb', line 15 def edit end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/iron/locales_controller.rb', line 7 def index @locales = Locale.all end |
#new ⇒ Object
11 12 13 |
# File 'app/controllers/iron/locales_controller.rb', line 11 def new @locale = Locale.new end |
#update ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/controllers/iron/locales_controller.rb', line 28 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 |