ecp.org/app/controllers/contacts_controller.rb
2023-03-09 18:30:35 -08:00

20 lines
392 B
Ruby

class ContactsController < ApplicationController
def index
@contact = Contact.new
end
def new
@contact = Contact.new
end
def create
@contact = Contact.new(params[:contact])
@contact.request = request
if @contact.deliver
flash.now[:success] = 'Message sent!'
else
flash.now[:error] = 'Could not send message'
render :new
end
end
end