简体   繁体   中英

Listing the different scaffolds generated in your rails application

I have generated two scaffold using the following two commands:

$:- rails generate scaffold User user:string gender:string
$:- rails generate scaffold Microposts microposts:string

Is there any command that will list me the different scaffolds i have generated so far? It should give me the output similar to this:

Scaffold generated:
User
Microposts

Not that I know of, but you can see the direct result in your application, plus after each scaffold you see which files are generated. To quote RoR guides:

A scaffold in Rails is a full set of model, database migration for that model, controller to manipulate it, views to view and manipulate the data, and a test suite for each of the above.

A scaffold in itself is not one thing, it's a collection. What would be the point of only displaying the name you used to scaffold all these files?

I don't think so - scaffolding generates models, views and controllers for a given class (in your case User and Microposts) - if you look at app/models you'll see User.rb and Microposts.rb . So maybe that's nearly the same thing?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM