Class: ContactController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ContactController
- Defined in:
- lib/forge/app/controllers/contact_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#index ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/forge/app/controllers/contact_controller.rb', line 4 def index @contact = Contact.new respond_to do |format| format.html { render :template => "pages/show" } format.mobile { render :template => "mobile/contact" } end end |
#submit ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/forge/app/controllers/contact_controller.rb', line 12 def submit @contact = Contact.new(params[:contact]) if @contact.valid? ContactMailer.contact(@contact).deliver flash[:notice] = "Thank you for sending your contact request!" else flash[:warning] = "There was a problem with your contact submission. Please see error messages below." end respond_to do |format| format.html { render :template => "pages/show" } format.mobile { render :template => "mobile/contact" } end end |