Module: Alexa::RenderHelper

Included in:
IntentHandlersController
Defined in:
app/helpers/alexa/render_helper.rb

Instance Method Summary collapse

Instance Method Details

#respond_for_alexa_with(alexa_response) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/alexa/render_helper.rb', line 3

def respond_for_alexa_with(alexa_response)
  if alexa_response.nil?
    render :not_found
  else
    # render json: alexa_response
    if alexa_response.is_a?(Alexa::Responses::Delegate)
      render json: alexa_response
    else
      render partial: 'alexa/response.json', locals: { response: alexa_response }
    end
  end
end