jeudi 4 février 2021

Active resource rails not fetching data

This is active.rb

class Active < ActiveResource::Base
    self.site = "http://localhost:3002/api/v1/users" # **When i run this it is not fetching data**

    self.site = Net::HTTP.get(URI.parse("http://localhost:3002/api/v1/users")) # **When i run this i can see the data in console. Will get error Bad URI**

end

welcome_controller.rb

 def index
    @active = Active.all
  end

I am Unable to fetch data from the using active resource. Please let me know Thank you

Aucun commentaire:

Enregistrer un commentaire