Class: Nuntius::Admin::LocalesController

Inherits:
Nuntius::ApplicationAdminController show all
Defined in:
app/controllers/nuntius/admin/locales_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



17
18
19
20
21
# File 'app/controllers/nuntius/admin/locales_controller.rb', line 17

def create
  @locale = Nuntius::Locale.new(locale_params)
  @locale.save
  respond_with :admin, @locale
end

#editObject



27
28
29
# File 'app/controllers/nuntius/admin/locales_controller.rb', line 27

def edit
  @locale = Nuntius::Locale.visible.find(params[:id])
end

#indexObject



8
9
10
# File 'app/controllers/nuntius/admin/locales_controller.rb', line 8

def index
  @locales = Nuntius::Locale.visible.order(:key)
end

#newObject



12
13
14
15
# File 'app/controllers/nuntius/admin/locales_controller.rb', line 12

def new
  @locale = Nuntius::Locale.new
  render :edit
end

#showObject



23
24
25
# File 'app/controllers/nuntius/admin/locales_controller.rb', line 23

def show
  redirect_to :edit_admin_locales, status: :see_other
end

#updateObject



31
32
33
34
35
# File 'app/controllers/nuntius/admin/locales_controller.rb', line 31

def update
  @locale = Nuntius::Locale.visible.find(params[:id])
  @locale.update(locale_params)
  respond_with :admin, @locale
end