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?
https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With