Sha256: bd61c2d880b57c1e30028d3c7629491e3135183506b52bae41123b8483eaa721

Contents?: true

Size: 580 Bytes

Versions: 1

Compression:

Stored size: 580 Bytes

Contents

require_dependency "i18n_dashboard/application_controller"

module I18nDashboard
  class TranslationsController < ::I18nDashboard::ApplicationController

    i18n_dashboard_authenticate

    def index
       @translations = Translation.all(params[:query])
    end

    def create
      Translation.create(params[:key], params[:value], params[:locale])
      redirect_to i18n_dashboard_root_path, :notice => "Added translations"
    end

    def destroy
      Translation.destroy(params[:id])
      redirect_to i18n_dashboard_root_path, :notice => "Key deleted"
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
i18n_dashboard-0.1.4 app/controllers/i18n_dashboard/translations_controller.rb