Sorry for my english.
I develop Ruby On Rails app (4.2.4) which interacts with Gitlab CI API ( using ActiveResource). I have list of projects on my remote resource and want to get it.
I created model GitlabResource:
require 'active_resource'
class GitlabResource < ActiveResource::Base
self.site = 'http://gitlab.example.com/ci'
self.include_format_in_path = false
end
And Project model
class Project < GitlabResource
self.prefix = '/api/v1/'
end
The docs says that one of the ways of authentication is with GitLab user token & GitLab url. And I need to add this parameters in each request.
when I use curl it works well:
curl http://gitlab.example.com/ci/api/v1/projects?private_token=AAAAQQQQAAAd&url=http://gitlab.example.com/
How can I add these parameters to the model GitlabResource? And do something like this:
@projects = Project.all
Upd. When I do
@projects = Project.find(:all, :params => { :private_token => 'AAAAQQQQAAAd', :url => 'http://gitlab.example.com/'})
Get error
Failed. Response code = 500. Response message = Internal Server Error.
Whats wrong?