Class: Spotlight::ContactFormsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/spotlight/contact_forms_controller.rb

Overview

Controller for routing exhibit feedback from users

Instance Method Summary collapse

Instance Method Details

#create ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'app/controllers/spotlight/contact_forms_controller.rb', line 14

def create
  if @contact_form.valid?
    ContactMailer.report_problem(@contact_form).deliver_now

    redirect_back_or_to(spotlight.new_exhibit_contact_form_path(current_exhibit), notice: t(:'helpers.submit.contact_form.created'))
  else
    render 'new'
  end
end

#new ⇒ Object



10
11
12
# File 'app/controllers/spotlight/contact_forms_controller.rb', line 10

def new
  @contact_form.current_url = request.referer
end