heylium_app/app/controllers/public/contacts_controller.rb
Nicolas Bally 8e18de4077 initial
2016-08-03 00:22:29 +02:00

27 lines
440 B
Ruby
Executable File

class Public::ContactsController < ApplicationController
layout "public"
def index
end
def new
@contact = Contact.new
end
def create
@contact = Contact.new(params.require(:contact).permit(:website, :place, :tel, :name, :email, :message))
if @contact.save
QuestionMailer.send_contact(@contact).deliver
render :action => :create
else
render :action => :new
end
end
end