Sha256: 536c17d25ca6b732e5467485239fc13ef6c366777deb0e3307acde7cabb4938e

Contents?: true

Size: 733 Bytes

Versions: 11

Compression:

Stored size: 733 Bytes

Contents

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

11 entries across 11 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc11 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.0.pre.rc10 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.0.pre.rc9 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.0.pre.rc8 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.0.pre.rc7 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.0.pre.rc6 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.0.pre.rc5 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.0.pre.rc4 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.0.pre.rc3 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.0.pre.rc1 app/presenters/renalware/letters/contacts_presenter.rb
renalware-core-2.0.0.pre.beta12 app/presenters/renalware/letters/contacts_presenter.rb