Sha256: 29ed2b7f046dd52b45b1cdac9666acf251c3afde9848ff56fe097019be6cb67e
Contents?: true
Size: 884 Bytes
Versions: 4
Compression:
Stored size: 884 Bytes
Contents
module Spotlight class ContactFormsController < Spotlight::ApplicationController load_and_authorize_resource :exhibit, class: Spotlight::Exhibit def new @contact_form = Spotlight::ContactForm.new :current_url => request.referer end def create @contact_form = Spotlight::ContactForm.new(contact_form_params) @contact_form.current_exhibit = current_exhibit @contact_form.request = request if @contact_form.valid? if @contact_form.respond_to? :deliver_now @contact_form.deliver_now else @contact_form.deliver end redirect_to :back, notice: t(:'helpers.submit.contact_form.created') else render 'new' end end protected def contact_form_params params.require(:contact_form).permit(:name, :email, :message, :current_url) end end end
Version data entries
4 entries across 4 versions & 1 rubygems