Generators

Could anyone tell me (or link me to) the best place to learn about RoR
Module Generators?

Pale H. wrote:

Could anyone tell me (or link me to) the best place to learn about RoR
Module Generators?

What do you want to know?

And what are you going to use them for? Unless they generate
extremely skeletal code, generators are a bad thing. (See
restful_authentication for an example of how not to use generators.)

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Marnen Laibow-Koser wrote:

Pale H. wrote:

Could anyone tell me (or link me to) the best place to learn about RoR
Module Generators?

What do you want to know?

And what are you going to use them for? Unless they generate
extremely skeletal code, generators are a bad thing. (See
restful_authentication for an example of how not to use generators.)

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

One example that I often use is a News feature… I just want to know
how I can build a generator and then, utilise it.

Rails comes with a number of generators (see the output of script/ generate for more information). None of them, however, are “Module
Generators”, so your question is impossible to answer as asked. A
module is a Ruby thing, not a Rails thing. Perhaps you can be more
specific as to what you want to generate or what goal you are trying
to accomplish?

Pale H. wrote:
[…]

One example that I often use is a News feature…

Bad example. A plugin would probably better here.

I just want to know
how I can build a generator and then, utilise it.

Again: don’t unless you’re sure that a plugin won’t be the better
choice.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]