Antony Nambikkai
2009-Nov-09 06:53 UTC
Active Scaffold Without Database connection --- Help
Hi Friends, I want to know what are ways or how to use the Active Scaffold without Database connection .... I mean Instead of Database I will have a CSV or Flat file..... Thro Active Scaffold Plug-in how to read this file instead of database.... Kindly Can I have you Ideas and Views..... ASAP..... - Antony -- Posted via http://www.ruby-forum.com/.
On Nov 9, 1:53 am, Antony Nambikkai <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi Friends, > > I want to know what are ways or how to use the Active Scaffold without > Database connection .... > > I mean Instead of Database I will have a CSV or Flat file..... > > Thro Active Scaffold Plug-in how to read this file instead of > database.... > > Kindly Can I have you Ideas and Views..... ASAP.....Um, how about "don''t do that"? With serverless storage engines like SQLite3 around, there''s no reason to fool with trying to read/write everything to a CSV file. --Matt Jones
Antony Nambikkai
2009-Nov-09 14:38 UTC
Re: Active Scaffold Without Database connection --- Help
Mr. Jones..... Its a Requirement.... Just to store simple name and a Id..... It will reduce my coding ..... Kindly provide you suggestion.> --Antony-- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Nov-09 14:44 UTC
Re: Active Scaffold Without Database connection --- Help
Antony Nambikkai wrote:> Mr. Jones..... Its a Requirement.... Just to store simple name and a > Id..... > It will reduce my coding .....Then, if you''re really set on ActiveScaffold, and if you really need CSV output, use the database for storage as Matt suggested, and just write to CSV on demand. Matt is right that using a CSV file as a database makes no sense.> > Kindly provide you suggestion. > >> --AntonyBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
I''ll second Marnen''s idea. With a DB you''ll get random access to any record. Using a CSV you''ll either have to read record by record until you find what you need or dump everything to an array or hash and then get it from there. I think it''s actually more work going the CSV approach. On Nov 9, 9:44 am, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> Antony Nambikkai wrote: > > Mr. Jones..... Its a Requirement.... Just to store simple name and a > > Id..... > > It will reduce my coding ..... > > Then, if you''re really set on ActiveScaffold, and if you really need CSV > output, use the database for storage as Matt suggested, and just write > to CSV on demand. Matt is right that using a CSV file as a database > makes no sense. > > > > > Kindly provide you suggestion. > > >> --Antony > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.
Antony Nambikkai
2009-Nov-10 04:57 UTC
Re: Active Scaffold Without Database connection --- Help
My qus is misleading you all I hope ...... Actual Scenario is ..... In out project there are lot of config pages..... ex : Setting server time.... so in csv or flat file .... it will not be more then 3 records...... we have 10 config like this as of now later it will be around 20...... If I use Active scaffold means I don''t need to create views I hope you get my point ....... -Antony -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Nov-10 05:02 UTC
Re: Active Scaffold Without Database connection --- Help
Antony Nambikkai wrote:> My qus is misleading you all I hope ...... > > Actual Scenario is ..... In out project there are lot of config > pages..... > > ex : Setting server time.... > > so in csv or flat file .... it will not be more then 3 records...... > > we have 10 config like this as of now later it will be around 20...... > > If I use Active scaffold means I don''t need to create views > > I hope you get my point .......You''re not listening. Let me make it clearer. Do not use ActiveScaffold with a CSV file -- it will not work. Use ActiveScaffold with a database. If no database, then no ActiveScaffold. Is that clear now?> > -AntonyBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.