Sha256: d29cb4842f396310feef5c9c0705059b3e3359a72e41c45ec2f7da3a3417b47e
Contents?: true
Size: 955 Bytes
Versions: 22
Compression:
Stored size: 955 Bytes
Contents
class InquiriesController < ApplicationController before_filter :find_page, :only => [:create, :new] def thank_you @page = Page.find_by_menu_match("^/inquiries/thank_you$", :include => [:parts, :slugs]) end def new @inquiry = Inquiry.new end def create @inquiry = Inquiry.new(params[:inquiry]) if @inquiry.save 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 redirect_to thank_you_inquiries_url else render :action => 'new' end end protected def find_page @page = Page.find_by_link_url('/inquiries/new', :include => [:parts, :slugs]) end end
Version data entries
22 entries across 22 versions & 1 rubygems