Class: Gluttonberg::Admin::Settings::LocalesController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Gluttonberg::Admin::Settings::LocalesController
- Defined in:
- app/controllers/gluttonberg/admin/settings/locales_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 31 def create @locale = Locale.new(params["gluttonberg_locale"]) if @locale.save flash[:notice] = "The locale was successfully created." redirect_to admin_locales_path else render :new end end |
#delete ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 22 def delete display_delete_confirmation( :title => "Delete “#{@locale.name}” locale?", :url => admin_locale_path(@locale), :return_url => admin_locales_path , :warning => "Page localizations of this locale will also be deleted." ) end |
#destroy ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 51 def destroy if @locale.destroy flash[:notice] = "The locale was successfully deleted." redirect_to admin_locales_path else flash[:error] = "There was an error deleting the locale." redirect_to admin_locales_path end end |
#edit ⇒ Object
19 20 |
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 19 def edit end |
#index ⇒ Object
11 12 13 |
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 11 def index @locales = Locale.all end |
#new ⇒ Object
15 16 17 |
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 15 def new @locale = Locale.new end |
#update ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 41 def update if @locale.update_attributes(params["gluttonberg_locale"]) || !@locale.dirty? flash[:notice] = "The locale was successfully updated." redirect_to admin_locales_path else flash[:error] = "Sorry, The locale could not be updated." render :edit end end |