Class: Hyrax::ContactForm
- Inherits:
-
Object
- Object
- Hyrax::ContactForm
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/hyrax/contact_form.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#contact_method ⇒ Object
Returns the value of attribute contact_method.
-
#email ⇒ Object
Returns the value of attribute email.
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
-
#subject ⇒ Object
Returns the value of attribute subject.
Class Method Summary collapse
Instance Method Summary collapse
-
#headers ⇒ Object
Declare the e-mail headers.
-
#spam? ⇒ Boolean
They should not have filled out the ‘contact_method’ field.
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
4 5 6 |
# File 'app/models/hyrax/contact_form.rb', line 4 def category @category end |
#contact_method ⇒ Object
Returns the value of attribute contact_method.
4 5 6 |
# File 'app/models/hyrax/contact_form.rb', line 4 def contact_method @contact_method end |
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'app/models/hyrax/contact_form.rb', line 4 def email @email end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'app/models/hyrax/contact_form.rb', line 4 def @message end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'app/models/hyrax/contact_form.rb', line 4 def name @name end |
#subject ⇒ Object
Returns the value of attribute subject.
4 5 6 |
# File 'app/models/hyrax/contact_form.rb', line 4 def subject @subject end |
Class Method Details
.issue_types_for_locale ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'app/models/hyrax/contact_form.rb', line 25 def self.issue_types_for_locale [ I18n.t('hyrax.contact_form.issue_types.depositing'), I18n.t('hyrax.contact_form.issue_types.changing'), I18n.t('hyrax.contact_form.issue_types.browsing'), I18n.t('hyrax.contact_form.issue_types.reporting'), I18n.t('hyrax.contact_form.issue_types.general') ] end |
Instance Method Details
#headers ⇒ Object
Declare the e-mail headers. It accepts anything the mail method in ActionMailer accepts.
17 18 19 20 21 22 23 |
# File 'app/models/hyrax/contact_form.rb', line 17 def headers { subject: "#{Hyrax.config.subject_prefix} #{subject}", to: Hyrax.config.contact_email, from: email } end |
#spam? ⇒ Boolean
They should not have filled out the ‘contact_method’ field. That’s there to prevent spam.
11 12 13 |
# File 'app/models/hyrax/contact_form.rb', line 11 def spam? contact_method.present? end |