ballalama3_app/app/controllers/contacts_controller.rb
Nicolas Bally bc774b8159 initial
2016-12-01 10:54:16 +01:00

27 lines
430 B
Ruby

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, :name, :email, :message))
if @contact.save
QuestionMailer.send_contact(@contact).deliver
redirect_to :action => :index
else
render :action => :new
end
end
end