Sha256: a666ead092430697032c9022dec89cea8b66f2b248c8c0b7c9fb8d5b4b501f57

Contents?: true

Size: 764 Bytes

Versions: 158

Compression:

Stored size: 764 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/letters"
require_dependency "collection_presenter"

module Renalware
  module Letters
    class ContactsPresenter < CollectionPresenter
      # An array of contacts for use in a simple_form drop down.
      # The data-salutation is added (the final hash argument very kindly merges * onto the <option>
      # so we could add other options here too.
      def array_for_drop_down_with_options
        map do |contact|
          [
            contact.name_and_description,
            contact.id,
            {
              data: {
                salutation: contact.salutation,
                class: ".has_salutation"
              }
            }
          ]
        end
      end
    end
  end
end

Version data entries

158 entries across 158 versions & 1 rubygems

Version Path
renalware-core-2.0.104 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.103 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.102 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.101 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.100 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.99 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.98 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.97 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.96 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.95 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.94 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.93 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.92 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.91 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.90 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.89 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.88 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.87 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.86 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.85 app/presenters/renalware/letters/contacts_presenter.rb