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, #exhibit_masthead?, #exhibit_search_action_url, #exhibit_search_facet_url, #resource_masthead?, #search_action_url, #search_facet_url

Methods included from Config

#exhibit_specific_blacklight_config

Instance Method Details

#createObject



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

def create
  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

#newObject



8
9
10
# File 'app/controllers/spotlight/contact_forms_controller.rb', line 8

def new
  @contact_form.current_url = request.referer
end