This repository was archived by the owner on Apr 19, 2026. It is now read-only.
Description 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?
Reactions are currently unavailable
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 < ApplicationControllerskip_before_action :verify_authenticity_tokendef my_actionclient = 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 {}endendendIt blocks the request to API.AI what is going on?