Class: Locomotive::TranslationsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/locomotive/translations_controller.rb

Instance Method Summary collapse

Instance Method Details

#bulk_destroyObject



27
28
29
30
31
# File 'app/controllers/locomotive/translations_controller.rb', line 27

def bulk_destroy
  authorize Translation, :destroy?
  service.bulk_destroy(params[:ids].split(','))
  respond_with current_site, location: translations_path(current_site, translation_nav_params)
end

#editObject



16
17
18
19
# File 'app/controllers/locomotive/translations_controller.rb', line 16

def edit
  authorize @translation
  respond_with @translation
end

#indexObject



10
11
12
13
14
# File 'app/controllers/locomotive/translations_controller.rb', line 10

def index
  authorize Translation
  @translations = service.all(params.slice(:page, :per_page, :q, :filter_by))
  respond_with @translations
end

#updateObject



21
22
23
24
25
# File 'app/controllers/locomotive/translations_controller.rb', line 21

def update
  authorize @translation
  service.update(@translation, translation_params[:values].to_h)
  respond_with @translation, location: translations_path(current_site, translation_nav_params)
end