Skip to content

NameError (uninitialized constant MyController::ApiAiRuby): #23

@jorgecuevas92

Description

@jorgecuevas92

I'm getting the following error when trying to activate the controller action that executes the api call:

`NameError (uninitialized constant MyController::ApiAiRuby):

app/controllers/maya_controller.rb:5:in my_action' Rendering /var/lib/gems/2.3.0/gems/actionpack-5.0.6/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout Rendering /var/lib/gems/2.3.0/gems/actionpack-5.0.6/lib/action_dispatch/middleware/templates/rescues/_source.html.erb Rendered /var/lib/gems/2.3.0/gems/actionpack-5.0.6/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (5.5ms) Rendering /var/lib/gems/2.3.0/gems/actionpack-5.0.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb Rendered /var/lib/gems/2.3.0/gems/actionpack-5.0.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.3ms) Rendering /var/lib/gems/2.3.0/gems/actionpack-5.0.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb Rendered /var/lib/gems/2.3.0/gems/actionpack-5.0.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms) Rendered /var/lib/gems/2.3.0/gems/actionpack-5.0.6/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (22.9ms)

My controller looks as follows:

class MyController < ApplicationController
skip_before_action :verify_authenticity_token
def my_action
client = ApiAiRuby::Client.new(
:client_acess_token => '###############################'
)
response = client.text_request "#{params[:transcript]}"
result = response[:result]
Rails.logger.debug("#{response}")
respond_to do |format|
format.js {}
end
end
end

It blocks the request to API.AI what is going on?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions