skarayan
2009-Oct-28 13:57 UTC
What''s the simplest way to use ActiveResource in ruby (without rails)?
I would like to use this class in a standalone project, but I have been unsuccessful thus far. Also, how does this class exactly communicate with the web server? Thank you. class Person < ActiveResource::Base self.site = "http://localhost:3000/" end
Ilan Berci
2009-Oct-29 19:29 UTC
Re: What''s the simplest way to use ActiveResource in ruby (without rails)?
skarayan wrote:> I would like to use this class in a standalone project, but I have > been unsuccessful thus far. > Also, how does this class exactly communicate with the web server? > Thank you. > > class Person < ActiveResource::Base > self.site = "http://localhost:3000/" > endLook at the docs: http://api.rubyonrails.org/ and specifically: ActiveRecord::Base.establish_connection() ActiveRecord::Base.establish_connection( :adapter => "mysql", :host => "localhost", :username => "myuser", :password => "mypass", :database => "somedatabase" ) hth ilan -- Posted via http://www.ruby-forum.com/.
skarayan
2009-Oct-30 09:27 UTC
Re: What''s the simplest way to use ActiveResource in ruby (without rails)?
Thank you for the response, but I am looking for ActiveResource and not ActiveRecord. ActiveResource is the REST component of Rails. On Oct 29, 3:29 pm, Ilan Berci <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> skarayan wrote: > > I would like to use this class in a standalone project, but I have > > been unsuccessful thus far. > > Also, how does this class exactly communicate with the web server? > > Thank you. > > > class Person < ActiveResource::Base > > self.site = "http://localhost:3000/" > > end > > Look at the docs:http://api.rubyonrails.org/ > > and specifically: ActiveRecord::Base.establish_connection() > > ActiveRecord::Base.establish_connection( > :adapter => "mysql", > :host => "localhost", > :username => "myuser", > :password => "mypass", > :database => "somedatabase" > ) > > hth > > ilan > -- > Posted viahttp://www.ruby-forum.com/.