Class: Gluttonberg::Admin::Settings::LocalesController

Inherits:
BaseController show all
Defined in:
app/controllers/gluttonberg/admin/settings/locales_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



31
32
33
34
35
36
37
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 31

def create
  @locale = Locale.new(params[:gluttonberg_locale])
  generic_create(@locale, {
    :name => "locale",
    :success_path => admin_locales_path
  })
end

#deleteObject



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

#destroyObject



47
48
49
50
51
52
53
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 47

def destroy
  generic_destroy(@locale, {
    :name => "locale",
    :success_path => admin_locales_path,
    :failure_path => admin_locales_path
  })
end

#editObject



19
20
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 19

def edit
end

#indexObject



11
12
13
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 11

def index
  @locales = Locale.all
end

#newObject



15
16
17
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 15

def new
  @locale   = Locale.new
end

#updateObject



39
40
41
42
43
44
45
# File 'app/controllers/gluttonberg/admin/settings/locales_controller.rb', line 39

def update
  @locale.assign_attributes(params["gluttonberg_locale"]) || !@locale.dirty?
  generic_update(@locale, {
    :name => "locale",
    :success_path => admin_locales_path
  })
end