Forum: Ruby on Rails RestClient::ResourceNotFound in UsersController#index

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
881a236ca533281bb9c9ac92f380b5a0?d=identicon&s=25 prabhu (Guest)
on 2014-04-17 15:17
(Received via mailing list)
Hi,

I am trying to implement Rest Api for a sample application for learning
purpose. But when I try to make a "GET" request through the RestClient
it
is showing error as

RestClient::ResourceNotFound in UsersController#index


def index
    uri = "#{API_BASE_URL}/users.json" # specifying json format in the
URl
    rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD) #
It
will create new rest-client resource so that we can call different
methods
of it
    users = rest_resource.get
    @users = JSON.parse(users, :symbolize_names => true) # we will
convert
the return data into array of hash.see json data parsing here
  end

Please help.
This topic is locked and can not be replied to.