Sha256: 12ff5e5726ddfe84d49820c7766501a939b10e76c1ee1d889d1ec887c90373d3

Contents?: true

Size: 1.01 KB

Versions: 26

Compression:

Stored size: 1.01 KB

Contents

module Locomotive
  class TranslationsController < BaseController

    sections :settings, :translations

    respond_to :json, only: [:create, :update]

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

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

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

    def edit
      respond_with @translation
    end

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

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

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
locomotive_cms-2.2.0 app/controllers/locomotive/translations_controller.rb
locomotive_cms-2.1.4 app/controllers/locomotive/translations_controller.rb
locomotive_cms-2.1.3 app/controllers/locomotive/translations_controller.rb
locomotive_cms-2.1.2 app/controllers/locomotive/translations_controller.rb
locomotive_cms-2.1.1 app/controllers/locomotive/translations_controller.rb
locomotive_cms-2.1.0 app/controllers/locomotive/translations_controller.rb