Sha256: 6ef5f0d15e3d8eb36a193d62ef1df07f9477e05e5603dabc7bd51e9ff46390f7

Contents?: true

Size: 637 Bytes

Versions: 35

Compression:

Stored size: 637 Bytes

Contents

module Renalware
  module PatientHelper
    def patient_menu_item(title:, path:, active_when_controller_matches:, enabled: true)
      klasses = %w(link)
      klasses << "active" if current_controller_matches(active_when_controller_matches)
      content_tag :li, class: klasses.join(" ") do
        if enabled
          link_to(title, path)
        else
          content_tag :span, title
        end
      end
    end

    def current_controller_matches(regex)
      regex.match(params[:controller]).present?
    end

    def formatted_nhs_number(patient)
      ::Renalware::PatientPresenter.new(patient).nhs_number
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc7 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.rc6 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.rc5 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.rc4 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.rc3 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.rc1 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.beta12 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.beta11 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.beta10 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.beta9 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.beta8 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.beta7 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.beta6 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.beta5 app/helpers/renalware/patient_helper.rb
renalware-core-2.0.0.pre.beta4 app/helpers/renalware/patient_helper.rb