Class: Dugway::Drops::ContactDrop

Inherits:
BaseDrop
  • Object
show all
Defined in:
lib/dugway/liquid/drops/contact_drop.rb

Instance Attribute Summary

Attributes inherited from BaseDrop

#params, #request, #source

Instance Method Summary collapse

Methods inherited from BaseDrop

#before_method, #cart, #context=, #error, #errors, #initialize, #method_missing, #store, #theme

Constructor Details

This class inherits a constructor from Dugway::Drops::BaseDrop

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Dugway::Drops::BaseDrop

Instance Method Details

#captchaObject



20
21
22
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 20

def captcha
  %{<img id="captcha_image" src="https://s3.amazonaws.com/bigcartel/captcha/28e3d1288cbc70c0cd1a2d10845f8e11e1a90d14.png">}
end

#emailObject



8
9
10
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 8

def email
  params[:email] ||= ''
end

#messageObject



16
17
18
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 16

def message
  params[:message] ||= ''
end

#nameObject



4
5
6
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 4

def name
  params[:name] ||= ''
end

#recaptchaObject



24
25
26
27
28
29
30
31
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 24

def recaptcha
  @recaptcha ||= begin
    html = "This site is protected by reCAPTCHA and the Google "
    html += '<a href="https://policies.google.com/privacy">Privacy Policy</a> and '
    html += '<a href="https://policies.google.com/terms">Terms of Service</a> apply.'
    html
  end
end

#sentObject



33
34
35
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 33

def sent
  request.path == '/contact' && request.post? && errors.blank?
end

#subjectObject



12
13
14
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 12

def subject
  params[:subject] ||= ''
end