Module: CCS::FrontendHelpers::CCSFrontend::PasswordStrength

Included in:
CCS::FrontendHelpers::CCSFrontend
Defined in:
lib/ccs/frontend_helpers/ccs_frontend/password_strength.rb

Overview

CCS Password Strength

This helper is used for generating the password strength component from the CCS - Components - Password Strength

Instance Method Summary collapse

Instance Method Details

#ccs_password_strength(password_id, password_strength_tests, **options) ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the CCS Password Strength component

Parameters:

  • password_id (String)

    The ID for the password element that will be checked against

  • password_strength_tests (Array<Hash>)

    An array of options for the password strength tests, See Test#initialize for details of the items in the array.

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :classes (String)

    additional CSS classes for the password strength HTML

  • :attributes (Hash)

    any additional attributes that will added as part of the HTML

Returns:

  • (ActiveSupport::SafeBuffer)


22
23
24
# File 'lib/ccs/frontend_helpers/ccs_frontend/password_strength.rb', line 22

def ccs_password_strength(password_id, password_strength_tests, **options)
  Components::CCS::PasswordStrength.new(password_id: password_id, password_strength_tests: password_strength_tests, context: self, **options).render
end