mirror of
https://github.com/edcommonwealth/ecp.org.git
synced 2026-03-07 21:48:13 -08:00
20 lines
547 B
Ruby
20 lines
547 B
Ruby
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
|