I was browsing the code at github.com/rails/rails, and I couldn't figure out where the code was to generate Rails scaffolds. Can anybody shed some light on this?
Asked
Active
Viewed 1,427 times
1 Answers
5
Did you find that? If you track down it's require, resource_generator, you'll find the code that creates the route. If you track down the resource_generator's requires, you'll find the model generator, helper generator, etc.
You won't find any single file that generates everything.
If I totally misunderstood your question and you just want to know what the command is, it's:
cd your/application/directory
Rails version < 3.0.0
script/generate scaffold model_name column_name:column_type
Rails version > 3.0.0
rails g scaffold model_name column_name:column_type

Preacher
- 2,410
- 1
- 19
- 29
-
You did not misunderstand the qvestion. Thanks for the first part of your answer. – Jay Godse Aug 01 '11 at 20:25