Sha256: 55ae27b47980cc74bba91c0e2b3f189df60dc4b0c375f4d642aa3f2c4019f4ab
Contents?: true
Size: 1021 Bytes
Versions: 15
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.deliver_notification(@inquiry, request) rescue logger.warn "There was an error delivering an inquiry notification.\n#{$!}\n" end begin InquiryMailer.deliver_confirmation(@inquiry, request) 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
15 entries across 15 versions & 1 rubygems