Forum: Ruby on Rails Using Modules

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Seth Buntin (Guest)
on 2006-06-13 23:30
I have setup my application so that the "admin" area is a module
(app/worm/ -> admin area) and the "site" area is in the app/ folder.

When I try to submit a basic form to the database it says:

This error occured while loading the following files:
   worm/in_your_classroom_link.rb

Which I think this means is that it is looking for a worm module in my
models folder.  Why is that?  What do I need to do to prevent it from
doing that?  I am going to use these models in my "site" area so I would
like them viewable easily.

There is probably a simple solution but I can't seem to find it.

Thanks.

Seth
Alex Wayne (Guest)
on 2006-06-13 23:54
Seth Buntin wrote:
> I have setup my application so that the "admin" area is a module
> (app/worm/ -> admin area) and the "site" area is in the app/ folder.
>
> When I try to submit a basic form to the database it says:
>
> This error occured while loading the following files:
>    worm/in_your_classroom_link.rb
>
> Which I think this means is that it is looking for a worm module in my
> models folder.  Why is that?  What do I need to do to prevent it from
> doing that?  I am going to use these models in my "site" area so I would
> like them viewable easily.
>
> There is probably a simple solution but I can't seem to find it.
>
> Thanks.
>
> Seth

Are you saying you have it structured like this?

  app
    -controllers
    -models
    -views
    -worm
      -controllers
      -models
      -views

Because it should look more like this:

  app
    -controllers
      -worm
        #worm controllers here
    -models
    -views
      -worm
        # folders of views for worm controllers
Seth Buntin (Guest)
on 2006-06-14 01:32
Alex Wayne wrote:
>
> Are you saying you have it structured like this?
>
>   app
>     -controllers
>     -models
>     -views
>     -worm
>       -controllers
>       -models
>       -views
>
> Because it should look more like this:
>
>   app
>     -controllers
>       -worm
>         #worm controllers here
>     -models
>     -views
>       -worm
>         # folders of views for worm controllers

I have it the right way.  Sorry if I confused you in the initial post.

Seth
This topic is locked and can not be replied to.