Question

I have a service that is running on 'http://localhost:4567/order_summary' so when I go to that address it shows me the JSON representation of it which is what I want.

Now in another Rail application I created a Controller as simple as this to start working on calling that service and working with its JSON:

class PharmacyController < ApplicationController
  def index
    result = Typhoeus::Request::get('http://localhost:4567/order_summary')
    @code = result.code
  end
end

but when I go to http://localhost:3000/pharmacy/ address I get the error of

NameError in PharmacyController#index

uninitialized constant PharmacyController::Typhoeus

What is it that I should initilaize it based on that error?

Was it helpful?

Solution

The only issue I can see is that you might not have Typhoeus in your Gemfile or you didn't require it require 'typhoeus'

Does that help?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top