Class: Spotlight::ContactForm

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/spotlight/contact_form.rb

Overview

Exhibit feedback form

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_exhibitObject

Returns the value of attribute current_exhibit.



7
8
9
# File 'app/models/spotlight/contact_form.rb', line 7

def current_exhibit
  @current_exhibit
end

#current_urlObject

Returns the value of attribute current_url.



7
8
9
# File 'app/models/spotlight/contact_form.rb', line 7

def current_url
  @current_url
end

#emailObject

Returns the value of attribute email.



7
8
9
# File 'app/models/spotlight/contact_form.rb', line 7

def email
  @email
end

#messageObject

Returns the value of attribute message.



7
8
9
# File 'app/models/spotlight/contact_form.rb', line 7

def message
  @message
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'app/models/spotlight/contact_form.rb', line 7

def name
  @name
end

#requestObject

Returns the value of attribute request.



7
8
9
# File 'app/models/spotlight/contact_form.rb', line 7

def request
  @request
end

Instance Method Details

#headersObject



11
12
13
14
15
16
17
18
# File 'app/models/spotlight/contact_form.rb', line 11

def headers
  {
    to: to,
    subject: "#{I18n.t(:'blacklight.application_name')} Contact Form",
    from: %("#{name}" <#{email}>),
    cc: current_exhibit.contact_emails.join(', ')
  }
end