ual_app/app/controllers/public/contacts_controller.rb
2014-08-24 22:47:24 +02:00

27 lines
426 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
render :action => :create
else
render :action => :new
end
end
end