I''m looking to start using Rails, but because of the learning curve and my new-ness to Ruby, I want to try using Active Record in a small command line app. So far I''ve only found one tutorial on the web about using active record outside rails at http://wiki.rubyonrails.com/rails/show/HowToUseActiveRecordOutsideRails. Can anyone point me to a beginner tutorial on active record, especially if it''s used outside of the rest of rails? Thanks Lowell
Lowell, The beta book''s treatment of AR gives some pretty concrete examples of doing what you want. The major difference is that you set up the connection in your code, and the rest is all the same as if it were done inside rails. On 6/21/05, Lowell Kirsh <lowellk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m looking to start using Rails, but because of the learning curve > and my new-ness to Ruby, I want to try using Active Record in a small > command line app. So far I''ve only found one tutorial on the web about > using active record outside rails at > http://wiki.rubyonrails.com/rails/show/HowToUseActiveRecordOutsideRails. > Can anyone point me to a beginner tutorial on active record, > especially if it''s used outside of the rest of rails? > > Thanks > Lowell > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
What''s your question? It''s actually very simple. You can inspect script/console to get the requires involved in revving up the framework. Peter J. Fitzgibbons Applications Manager Lakewood Homes - "The American Dream Builder"(r) Peter.Fitzgibbons-STCS76aLmhk1y/cD6r8xzl6hYfS7NtTn@public.gmane.org (847) 884-8800 -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Lowell Kirsh Sent: Tuesday, June 21, 2005 5:20 AM To: Rails Subject: [Rails] active record outside rails I''m looking to start using Rails, but because of the learning curve and my new-ness to Ruby, I want to try using Active Record in a small command line app. So far I''ve only found one tutorial on the web about using active record outside rails at http://wiki.rubyonrails.com/rails/show/HowToUseActiveRecordOutsideRails. Can anyone point me to a beginner tutorial on active record, especially if it''s used outside of the rest of rails? Thanks Lowell _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I would agree, _once you know how_ it is really simple. I have some code working that is pretty much a copy/paste/customize operation from the http://wiki.rubyonrails.com/rails/show/HowToPopulateYourDbFromScript howto. I posted my version at http://kellyfelkins.org/pub/ar-example.html Perhaps this will help. -Kelly On 6/21/05, Peter Fitzgibbons <Peter.Fitzgibbons-p2lxMnUesd41y/cD6r8xzl6hYfS7NtTn@public.gmane.org> wrote:> > What''s your question? It''s actually very simple. You can inspect > script/console to get the requires involved in revving up the framework. > > > > Peter J. Fitzgibbons > Applications Manager > Lakewood Homes - "The American Dream Builder"(r) > Peter.Fitzgibbons-STCS76aLmhk1y/cD6r8xzl6hYfS7NtTn@public.gmane.org > (847) 884-8800 > > > -----Original Message----- > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Lowell Kirsh > Sent: Tuesday, June 21, 2005 5:20 AM > To: Rails > Subject: [Rails] active record outside rails > > I''m looking to start using Rails, but because of the learning curve and > my new-ness to Ruby, I want to try using Active Record in a small > command line app. So far I''ve only found one tutorial on the web about > using active record outside rails at > http://wiki.rubyonrails.com/rails/show/HowToUseActiveRecordOutsideRails. > Can anyone point me to a beginner tutorial on active record, especially > if it''s used outside of the rest of rails? > > Thanks > Lowell > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Thanks all for your replies. You''ve given me exactly what I am looking for, especially your code, Kelly. Lowell On 6/21/05, Kelly Felkins <kelly.felkins-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I would agree, _once you know how_ it is really simple. I have some code > working that is pretty much a copy/paste/customize operation from the > http://wiki.rubyonrails.com/rails/show/HowToPopulateYourDbFromScript > howto. > > I posted my version at > > http://kellyfelkins.org/pub/ar-example.html > > Perhaps this will help. > > -Kelly > > > On 6/21/05, Peter Fitzgibbons > <Peter.Fitzgibbons-p2lxMnUesd41y/cD6r8xzl6hYfS7NtTn@public.gmane.org> wrote: > > > > What''s your question? It''s actually very simple. You can inspect > > script/console to get the requires involved in revving up the framework. > > > > > > > > Peter J. Fitzgibbons > > Applications Manager > > Lakewood Homes - "The American Dream Builder"(r) > > Peter.Fitzgibbons-STCS76aLmhk1y/cD6r8xzl6hYfS7NtTn@public.gmane.org > > (847) 884-8800 > > > > > > -----Original Message----- > > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org ] On Behalf > Of Lowell Kirsh > > Sent: Tuesday, June 21, 2005 5:20 AM > > To: Rails > > Subject: [Rails] active record outside rails > > > > I''m looking to start using Rails, but because of the learning curve and > > my new-ness to Ruby, I want to try using Active Record in a small > > command line app. So far I''ve only found one tutorial on the web about > > using active record outside rails at > > > http://wiki.rubyonrails.com/rails/show/HowToUseActiveRecordOutsideRails > . > > Can anyone point me to a beginner tutorial on active record, especially > > if it''s used outside of the rest of rails? > > > > Thanks > > Lowell > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >