The regular way of doing this with requires is simply that your 'controller'
files look like this:
module MyApp::Controllers
class PonyX
def get id
.. logic to look up pony with id ..
end
end
end
This can even be generalized further I expect, to
class MyApp::Controllers::PonyX
…
end
This way you totally avoid weird evaling hacks, and are just writing plain old
straight forward ruby code with no magic (as is the Camping way). It works
because camping allows you to reopen modules and classes again and again by
defining them several times, adding new classes or adding new methods to
existing classes.
—
Jenna Fox
On Monday, 19 December 2011 at 8:56 AM, [email protected] wrote:
> What I am doing now is basically the same as requiring. If I do require
> with all the files, they don't become a part of the controllers module.
>
> The problem is that having to require (or in my case 'add') ever
> controller is *not* a very good way to work. It would be much better to be
> able to just do:
>
> set :controllers, *path to controllers*
>
> Because in the long run, that saves you time, and a bunch of boring and
> tedious work.
>
> The problem isn't that the solution I currently have doesn't work, this is
> just a suggestion to make Camping so much better.
>
> > I don't think I understand the problem - can't you just `require` all
> > the files with controllers?
> >
> > -- Matma Rex
> > _______________________________________________
> > Camping-list mailing list
> > [email protected] (mailto:[email protected])
> > http://rubyforge.org/mailman/listinfo/camping-list
> >
> > ____________________________________________________________________________________
> > Find aldi jobs Online Get Started Now.
> > http://click.lavabit.com/db5fe7a9kai9wirqj77kjjiskdphxcqqrdiye5hkpuyeyn1bah8y/
> > ____________________________________________________________________________________
> >
>
>
>
>
> _______________________________________________
> Camping-list mailing list
> [email protected] (mailto:[email protected])
> http://rubyforge.org/mailman/listinfo/camping-list
>
>
_______________________________________________
Camping-list mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/camping-list