Class: Dugway::Drops::ContactDrop
- Inherits:
-
BaseDrop
- Object
- Liquid::Drop
- BaseDrop
- Dugway::Drops::ContactDrop
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
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Dugway::Drops::BaseDrop
Instance Method Details
#captcha ⇒ Object
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
|
#email ⇒ Object
8
9
10
|
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 8
def email
params[:email] ||= ''
end
|
#message ⇒ Object
16
17
18
|
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 16
def message
params[:message] ||= ''
end
|
#name ⇒ Object
4
5
6
|
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 4
def name
params[:name] ||= ''
end
|
#recaptcha ⇒ Object
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
|
#sent ⇒ Object
33
34
35
|
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 33
def sent
request.path == '/contact' && request.post? && errors.blank?
end
|
#subject ⇒ Object
12
13
14
|
# File 'lib/dugway/liquid/drops/contact_drop.rb', line 12
def subject
params[:subject] ||= ''
end
|