Sha256: 2f09a46f6c67cde5bd02136a4eb00a03027c46b75e3d811a30ed848012af3f0c

Contents?: true

Size: 493 Bytes

Versions: 36

Compression:

Stored size: 493 Bytes

Contents

class AuthenticatedController < ApplicationController

  if Rails.version.to_i >= 5
    before_action :authenticate
  else
    before_filter :authenticate
  end

  def page
    if Rails.version.to_i >= 5
      render :plain => 'Action reached'
    else
      render :text => 'Action reached'
    end
  end

  private

  def authenticate
    authenticate_or_request_with_http_basic('Administration') do |username, password|
      username == 'user' && password == 'password'
    end
  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
spreewald-4.1.0 tests/shared/app/controllers/authenticated_controller.rb
spreewald-3.0.3 tests/shared/app/controllers/authenticated_controller.rb
spreewald-3.0.2 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.99.3 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.99.2 tests/shared/app/controllers/authenticated_controller.rb
spreewald-3.0.1 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.99.1 tests/shared/app/controllers/authenticated_controller.rb
spreewald-3.0.0 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.99.0 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.9.0 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.8.0 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.7.1 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.7.0 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.6.0 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.5.0 tests/shared/app/controllers/authenticated_controller.rb
spreewald-2.4.2 tests/shared/app/controllers/authenticated_controller.rb