I''m not totally sure on this, but I *think* that Rails assumes that if
you have a model in a subfolder, then it''s part of a module. For
example, if you have a layout like
models
| subfolder
| MyModel.rb
Then you would need to change the class declaration in MyModel.rb to
subfolder::MyModel, because Rails will think that MyModel is in the
''subfolder'' namespace.
As I said, I''m not sure about this, but I think that''s the
case.
Pat
On 12/1/05, Ben Reubenstien <benr-gpfhg/Mf3zw@public.gmane.org>
wrote:> Hello ~
>
> I was under the impression that Rails looped through the folders in
> your app adding classes dynamically. For example I have:
>
> #{RAILS_ROOT}/app/models/folder_with_more_classes/even_more/maybe_more
>
> After moving my files into these folders, our app died. I got it to
> work again by adding the paths to the environment.rb in the
> config.load_paths. Is there an option I am missing which will do this
> automatically? My load_paths is going to get very long.
>
> Thx,
>
> ~ Ben
>
> --
> Ben Reubenstein
> http://www.benr75.com/
> benr-gpfhg/Mf3zw@public.gmane.org
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>