add honeypot to contact us form
This commit is contained in:
parent
3df1001811
commit
15a5ecbba2
@ -28,8 +28,8 @@ class PagesController < ApplicationController
|
||||
# if no message
|
||||
elsif params[:message].blank?
|
||||
flash[:alert] = t(:contact_us_no_message)
|
||||
# else send email
|
||||
else
|
||||
# else send email if not a spambot
|
||||
elsif params[:userlogin].blank?
|
||||
Mailer.contact_us(params[:email], params[:message]).deliver
|
||||
flash[:notice] = t(:contact_us_success)
|
||||
end
|
||||
|
@ -1,4 +1,6 @@
|
||||
<%= form_tag({:controller => 'pages', :action => 'contact_us', :method => :post}, :class => 'form-horizontal') do %>
|
||||
<input name='userlogin' class='userlogin' />
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 col-xs-3 control-label"><%= t(:email_address).titleize %></label>
|
||||
<div class="col-sm-4 col-xs-9"><%= text_field_tag :email, (current_user.present? ? current_user.email : nil), :class => 'form-control' %></div>
|
||||
|
Loading…
Reference in New Issue
Block a user