This project is archived and is in readonly mode.
A simple way to copy the default generator templates is needed
-
Rodrigo Urubatan
- Tag changed from generator, personalization, templates to generator, patch, personalization, templates
-
José Valim
- Milestone cleared.
- Tag changed from generator, patch, personalization, templates to bugmash, generator, patch, personalization, templates
- State changed from new to open
- Assigned user set to José Valim
The idea seems good, but the patch needs to be improved. No need to load rubygems since you are already inside the railties gem (just use FILE). You should also use FileUtils.cp_r to simplify the code!
-
Rodrigo Urubatan
DRYied up the code a little, removed the rubygems reference, now using FILE to lookup the directory, and using cp_r to simplify file copy.
Any other suggestions are welcome. -
Jeroen van Dijk
I like this idea.
When I apply this patch it gives me errors for the mailer and I think the code can be cleaned up a bit. I also think this Rake task should be under the rails namespace.
So I refactored the patch and I have tested it manually on a new application.
It seems that the erb templates are not used by the "rails g" command, is that correct? Maybe we can remove those from the code? and make it more simple?
-
José Valim
erb templates are used by rails g command.
I would like to credit Urubatan in this patch as well.
Jeroen, is it ok if I change the author to "Jeroen van Dijk + Rodrigo Urubatan" so you both get the credit? -
Jeroen van Dijk
For the record, as said on IRC, thats ok Jose! Thanks
-
Repository
- State changed from open to resolved
(from [80fc6536bda191731e3963f1539c84a7b0c4e764]) Added Rake task rails:templates:copy to copy templates for customization [#4574 A simple way to copy the default generator templates is needed state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/80fc6536bda191731e3963f1539c84...
