You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.
Yeah I wanted to look into doing something similar for a different generator but came up short.
Generators and the underlying Thor tool are heavily based around the idea of command line input. I felt it would be too much of a hack to try and get them working with some sort of other input.
If you are interested in entering complex data, I suggest you use the ask and yes methods to prompt the user for that information at a later point, even if it is immediately after initializing the generator. I think this makes the generator more usable as well because it gives you an opportunity to be more descriptive with what should be entered, and the format, than a yaml file.
You could also put in sensible defaults for all of these questions and then have a quite argument for the generator that defaults to false. Setting it to true would skip all of the questions and just use the defaults.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
such that
rails g nifty_scaffold attribute1:type attribute2:type
becomes
rails g niftiest_scaffold /path/to/yaml/file/describing/attributes.yml
and the scaffold generator reads the yml file and creates the scaffold with those parameters.
Any tips on doing this?
TIA,
chewmanfoo
The text was updated successfully, but these errors were encountered: