mirror of
https://github.com/edcommonwealth/ecp.org.git
synced 2026-03-13 17:30:27 -07:00
Update contact form so it confirms the message was sent
This commit is contained in:
parent
7f433cf223
commit
f8c91add3e
7 changed files with 25 additions and 10 deletions
|
|
@ -1,5 +1,20 @@
|
|||
class HomeController < ApplicationController
|
||||
skip_before_action :verify_authenticity_token
|
||||
def index
|
||||
@contact = Contact.new
|
||||
end
|
||||
|
||||
def create
|
||||
puts '***************************** Inside home controller *****************************************'
|
||||
|
||||
flash.now[:success] = 'Message sent!'
|
||||
@contact = Contact.new(params[:contact])
|
||||
@contact.request = request
|
||||
if @contact.deliver
|
||||
flash.now[:success] = 'Message sent!'
|
||||
else
|
||||
flash.now[:error] = 'Could not send message'
|
||||
end
|
||||
render :index
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue