Sha256: 04ed7358eedf8e83a209a7ba7d5367224c866279d0d54e2688cb267a0b17a670

Contents?: true

Size: 363 Bytes

Versions: 7

Compression:

Stored size: 363 Bytes

Contents

module I18nline
  class ApplicationController < ActionController::Base
    before_action :check_authenticated_user

    private

    def check_authenticated_user
      unless(I18nline.current_user and I18nline.current_user.try(I18nline.can_translate_method))
        redirect_to I18nline::login_route, error: "You need to login first"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
i18nline-0.0.7.alpha app/controllers/i18nline/application_controller.rb
i18nline-0.0.6.alpha app/controllers/i18nline/application_controller.rb
i18nline-rails-0.0.5.alpha app/controllers/i18nline/application_controller.rb
i18nline-0.0.5.alpha app/controllers/i18nline/application_controller.rb
i18nline-0.0.4.alpha app/controllers/i18nline/application_controller.rb
i18nline-0.0.3.alpha app/controllers/i18nline/application_controller.rb
i18nline-0.0.2.alpha app/controllers/i18nline/application_controller.rb