07-01-2017 04:40
07-01-2017 04:40
I am new to the development world and this is my first application. The login took me long enough ha, on to the hard part. The below call worked via apigee and cannot figure out how to fetch my user data. I know it has something to do with the redirect and maybe the "-" line where current_user.uid line is. I am not sure but if anyone has any insight it would be greatly appreciated.
```
class ActivitiesController < ApplicationController
def index
data = fit_data
end
private
def fit_data(date: Date.today)
binding.pry
string = "Bearer #{current_user.access_token}"
response = RestClient.get "https://api.fitbit.com/1/user/#{current_user.uid}/activities/date/#{date}.json", {Authorization: string, Host: "api.fitbit.com", Connection: "Keep-Alive"}
output = JSON.parse(response)
end
```