Active Scaffold Without Database connection --- Help

1 view
Skip to first unread message

Antony Nambikkai

unread,
Nov 9, 2009, 1:53:55 AM11/9/09
to rubyonra...@googlegroups.com
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/.

Matt Jones

unread,
Nov 9, 2009, 9:18:04 AM11/9/09
to Ruby on Rails: Talk


On Nov 9, 1:53 am, Antony Nambikkai <rails-mailing-l...@andreas-s.net>
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

unread,
Nov 9, 2009, 9:38:30 AM11/9/09
to rubyonra...@googlegroups.com
Mr. Jones..... Its a Requirement.... Just to store simple name and a
Id.....
It will reduce my coding .....

Kindly provide you suggestion.

> --Antony

Marnen Laibow-Koser

unread,
Nov 9, 2009, 9:44:25 AM11/9/09
to rubyonra...@googlegroups.com
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-Koser
http://www.marnen.org
mar...@marnen.org

pepe

unread,
Nov 9, 2009, 6:34:02 PM11/9/09
to Ruby on Rails: Talk
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-

Antony Nambikkai

unread,
Nov 9, 2009, 11:57:23 PM11/9/09
to rubyonra...@googlegroups.com
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

Marnen Laibow-Koser

unread,
Nov 10, 2009, 12:02:19 AM11/10/09
to rubyonra...@googlegroups.com
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?

>
> -Antony

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

Reply all
Reply to author
Forward
0 new messages