| View previous topic :: View next topic |
| Author |
Message |
micromind_nyros
Joined: 22 Jan 2008 Posts: 38
|
Posted: Wed Sep 16, 2009 2:17 pm Post subject: Problem with using ActiveResource for my ActiveRecord |
|
|
Hi Guys,
I have problem for getting records from ActiveResource for API Resources , when they are having Authentication .
So , how can we get records from ActiveResource if it contains Authentications .
Thank you, |
|
| Back to top |
|
 |
sivakrishna.m
Joined: 01 Jan 2008 Posts: 160 Location: Narsipatnam
|
Posted: Wed Sep 16, 2009 2:24 pm Post subject: Re : Problem with using ActiveResource for my ActiveRecord |
|
|
Hi,
You Have solution for getting the records from ActiveResource for a API call has your ActiveRecords if they have any Authentications.
Simply putting the credentials in the URL's
for instance you are calling "http://api.people.com:3000/" From the Person ActiveResource class . then call it with your username and password like below:
class Person < ActiveResource::Base
self.site = "http://siva:password@api.people.com:3000/"
end
Thank You,
Siva. |
|
| Back to top |
|
 |
|