That''s an interesting idea; however, as I''ve worked with Rails
the
present grouping (with the exception of ''views'' being in a
folder of
its own) makes more sense as you go along. Here are some points that
may help in understanding the issues:
* Having a single "public" folder helps keep all of the available
javascripts, images and stylesheets in a single tree. It would be
confusing to have a public folder for each controller (or "module" as
you call them) since each of those application components are usually
shared across the entire app.
* There is no one-to-one or one-to-many correspondence between
controllers and models. It would not make sense to have a models
folder inside of the controller''s folder because each controller has a
wide variety of dependencies on different models within the
application. For example, a model describing the ''users''
table would
probably need to be accessed from nearly every controller in order for
the access / login procedure to work.
* Given that the models can not necessarily be placed inside of the
controller''s folder, it would not make sense to move the test folder
in there as well. Tests are performed on both models (unit tests) and
on controllers (functional tests). Having both types of tests in a
central location makes sense to me :)
Regards,
Duane Johnson
(canadaduane)
On Mon, 24 Jan 2005 00:44:05 +0100, zimba [tm]
<zimba.tm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I''m curious,
>
> why are the files of the app dispached in rails ?
>
> I mean when you create a controller with actions et all,
> you have a part in controller, helpers, views, /tests/..
>
> Wouldn''t it be more logical to have something more regrouped ?
>
> Something like this :
> app/
> modulename/
> models/
> public/
> tests/
> views/
> modulename_controller.rb
> modulename_helpers.rb
>
> I don''t know if it makes sense.
> This structure doesn''t support submodules and application-level
code,
> but it''s just an idea.
>
> --
> Cheers,
>
> zimba
> http://zimba.oree.ch
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>