aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/help_controller.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-02-19 17:41:57 +0000
committerfrancis <francis>2008-02-19 17:41:57 +0000
commit3bf799188dcb77884cab49327a4db23036ac31aa (patch)
tree06cf39d4cd228eac4d2cc61464911ed589305353 /app/controllers/help_controller.rb
parentc18401603797d061bd7ab429d7686c426480d408 (diff)
Contact form.
Diffstat (limited to 'app/controllers/help_controller.rb')
-rw-r--r--app/controllers/help_controller.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
index 8a58c1ade..26db31e62 100644
--- a/app/controllers/help_controller.rb
+++ b/app/controllers/help_controller.rb
@@ -4,11 +4,30 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: help_controller.rb,v 1.1 2008-01-09 15:35:40 francis Exp $
+# $Id: help_controller.rb,v 1.2 2008-02-19 17:41:58 francis Exp $
class HelpController < ApplicationController
def about
end
+ def contact
+ if params[:submitted_contact_form]
+ @contact = ContactValidator.new(params[:contact])
+ if @contact.valid?
+ ContactMailer.deliver_message(
+ params[:contact][:name],
+ params[:contact][:email],
+ params[:contact][:subject],
+ params[:contact][:message],
+ "IP #{request.env['REMOTE_HOST']}"
+ )
+ flash[:notice] = "Your message has been sent. Thank you for getting in touch! We'll get back to you soon."
+ redirect_to home_url
+ return
+ end
+ end
+
+ end
+
end