Class: Spotlight::ContactFormsController

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

Overview

Controller for routing exhibit feedback from users

Instance Method Summary collapse

Methods included from Spotlight::Concerns::ApplicationController

#enabled_in_spotlight_view_type_configuration?, #field_enabled?

Methods included from Controller

#blacklight_config, #current_exhibit, #current_masthead, #current_masthead=, #current_site, #default_url_options, #exhibit_masthead?, #exhibit_search_action_url, #exhibit_search_facet_path, #resource_masthead?, #search_action_url, #search_facet_path, #search_state, #set_exhibit_locale_scope, #set_locale

Methods included from Config

#exhibit_specific_blacklight_config

Instance Method Details

#createObject



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 fallback_location: spotlight.new_exhibit_contact_form_path(current_exhibit), notice: t(:'helpers.submit.contact_form.created')
  else
    render 'new'
  end
end

#newObject



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

def new
  @contact_form.current_url = request.referer
end