Sha256: 909ca3a5df9548f4e8e1a8923f0ef41d2cc5b93df375e5a8eeba57c6ee342cc2
Contents?: true
Size: 1021 Bytes
Versions: 14
Compression:
Stored size: 1021 Bytes
Contents
class InquiriesController < ApplicationController before_filter :find_page, :only => [:create, :new] def index redirect_to :action => "new" end def thank_you @page = Page.find_by_link_url("/contact/thank_you", :include => [:parts, :slugs]) end def new @inquiry = Inquiry.new end def create @inquiry = Inquiry.new(params[:inquiry]) if @inquiry.save if @inquiry.ham? begin InquiryMailer.notification(@inquiry, request).deliver rescue logger.warn "There was an error delivering an inquiry notification.\n#{$!}\n" end begin InquiryMailer.confirmation(@inquiry, request).deliver rescue logger.warn "There was an error delivering an inquiry confirmation:\n#{$!}\n" end end redirect_to thank_you_inquiries_url else render :action => 'new' end end protected def find_page @page = Page.find_by_link_url('/contact', :include => [:parts, :slugs]) end end
Version data entries
14 entries across 14 versions & 1 rubygems