Sha256: 0fd2e3eef400a4207a24f1bf3c68bccfb392391238087f010bfd52f84d1c3e93
Contents?: true
Size: 980 Bytes
Versions: 5
Compression:
Stored size: 980 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_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
5 entries across 5 versions & 1 rubygems