Class: FeedbackController

Inherits:
UmlautController show all
Defined in:
app/controllers/feedback_controller.rb

Defined Under Namespace

Classes: NoFeedbackEmailFoundException

Instance Method Summary collapse

Methods included from Umlaut::ControllerBehavior

#default_url_options, #set_locale

Methods included from UmlautConfigurable

set_default_configuration!

Instance Method Details

#createObject


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/feedback_controller.rb', line 7

def create    
  contact_config = contact_email_lookup(params[:contact_id])
  to_address = contact_config[:email_address]

  options = params.slice(:name, :email, :feedback)
  if params[:request_id] && umlaut_request = Request.find_by_id(params[:request_id])
    options = options.merge(
      :umlaut_request => umlaut_request
    )
  end

  action_mailer_deliver FeedbackMailer.feedback(request.host_with_port, to_address, options)

  flash[:alert_success] = "Thanks, your message has been sent."

  if umlaut_request
    redirect_to :controller => "resolve", :action => :index, "umlaut.request_id" => umlaut_request.id
  else
    redirect_to root_url
  end
end

#newObject


2
3
4
5
# File 'app/controllers/feedback_controller.rb', line 2

def new
  contact_email_lookup(params[:contact_id])
  # default render
end