# Newbie questions - create table and file browser?

**URL:** <https://www.ruby-forum.com/t/newbie-questions-create-table-and-file-browser/134914>\
**Category:** Rails\
**Created:** [April 16, 2008, 5:20am UTC](https://www.ruby-forum.com/t/newbie-questions-create-table-and-file-browser/134914 "2008-04-16T05:20:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![toro04](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@toro04](https://www.ruby-forum.com/u/toro04)\
**Post date:** [April 16, 2008, 5:20am UTC](https://www.ruby-forum.com/t/newbie-questions-create-table-and-file-browser/134914/1 "2008-04-16T05:20:30Z")

</div>

Hey Guys,

I am attempting to develop an application for managing my company’s  
workflow doing visual effects for the TV/film industry.

I have a few ruby on rails questions.

1. How can I create a new table in a database without using a migration?  
(I want to create a new table for every job we do - to keep track of all  
the versions of the effects and works in progress we do)

2. Is there anyway to browse directories/files on a server using rails?

Any help is greatly appreciated!

Cheers

Adam

---

<div class="post-metadata">

**Author:** ![toro04](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@toro04](https://www.ruby-forum.com/u/toro04)\
**Post date:** [April 16, 2008, 5:40am UTC](https://www.ruby-forum.com/t/newbie-questions-create-table-and-file-browser/134914/2 "2008-04-16T05:40:43Z")

</div>

Hi Phillip!

Thanks for replying so quickly.

It’s good to know so early on that I have the wrong approach to the  
tables! I’l read up on ActiveReord

Cheers!

---

<div class="post-metadata">

**Author:** ![toro04](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@toro04](https://www.ruby-forum.com/u/toro04)\
**Post date:** [April 16, 2008, 5:33am UTC](https://www.ruby-forum.com/t/newbie-questions-create-table-and-file-browser/134914/3 "2008-04-16T05:33:24Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Adam T. wrote:

| 1. How can I create a new table in a database without using a migration?

SQL. Exact details depend on the RDBMS you are going to use.

| (I want to create a new table for every job we do - to keep track of all  
| the versions of the effects and works in progress we do)

This is not a really well thought out idea. The amount of JOINs, UNIONs  
this invites is nasty, not to mention that it will be an administrative  
nightmare (glossing over the performance issues this might incur in  
production).

That’s what has\_many, has\_one, belongs\_to, belongs\_to\_many, etc… are  
for, Rails’ (or rather ActiveRecord’s) relationship methods. Yes, you  
can do that with the many, many tables you’ll have, too, but every  
single table will need a controller at least, maybe even a model. Not to  
mention you’ll end up having to inherit from a base class for the  
models. Not very DRY, and not very YAGNI, either.

Have fun maintaining the n+x controllers and possibly models, though.

| 2. Is there anyway to browse directories/files on a server using rails?

There should be. Ruby (the language Rails is written in) should allow  
for that, one way or another.

* * *

Phillip G.  
Twitter: [twitter.com/cynicalryan](http://twitter.com/cynicalryan)

~ I say, if your knees aren’t green by the end of the day, you ought  
to  
seriously re-examine your life. – Calvin  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.8 (MingW32)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org](http://enigmail.mozdev.org)

iEUEARECAAYFAkgFc0MACgkQbtAgaoJTgL8jhwCXfaSz6TwCYDPFdRnPETDsIsdm  
0gCgp7nDTTEmnYqruYQM9uSkKeR9rH4=  
=QGaI  
-----END PGP SIGNATURE-----
