Class: Locomotive::TranslationsController

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

Instance Method Summary collapse

Methods included from ActionController::Ssl

#require_ssl

Methods included from ActionController::UrlHelpers

#current_site_public_url, #public_page_url, #switch_to_site_url

Methods included from ActionController::SectionHelpers

#sections

Methods included from ActionController::LocaleHelpers

#back_to_default_site_locale, #current_content_locale, #localized?, #set_back_office_locale, #set_current_content_locale, #setup_i18n_fallbacks

Instance Method Details

#createObject



18
19
20
21
# File 'app/controllers/locomotive/translations_controller.rb', line 18

def create
  @translation = current_site.translations.create(params[:translation])
  respond_with @translation, location: translations_path
end

#destroyObject



33
34
35
36
37
# File 'app/controllers/locomotive/translations_controller.rb', line 33

def destroy
  @translation = current_site.translations.find(params[:id])
  @translation.destroy
  respond_with @translation, location: translations_path
end

#editObject



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

def edit
  respond_with @translation
end

#indexObject



8
9
10
11
# File 'app/controllers/locomotive/translations_controller.rb', line 8

def index
  @translations = current_site.translations.ordered.page(params[:page]).per(Locomotive.config.ui[:per_page])
  respond_with @translations
end

#newObject



13
14
15
16
# File 'app/controllers/locomotive/translations_controller.rb', line 13

def new
  @translation = current_site.translations.build
  respond_with @translation
end

#updateObject



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

def update
  @translation = current_site.translations.find(params[:id])
  @translation.update_attributes(params[:translation])
  respond_with @translation, location: translations_path
end