I\'m making a GET call to an external source using the gem \'httparty\'; here\'s my Controller.rb:
def show
response = HTTParty.get(\'URI\')
user = JSON.
Here I am assuming that you have created the uri_id field to store the external id and the name field to store the external name in the user table.
Your Controller code -
def show
response = HTTParty.get('URI')
JSON.parse(response).each do |item|
if (item.id != nil && item.name != nil)
u = User.new(:uri_id => item.id, :name => item.name)
u.save
end
end
end