简体   繁体   中英

How do I use the `--helper` flag in a rails 3 controller generator?

The documentation from rails generate controller says:

[--helper]                # Indicates when to generate helper
                          # Default: true

Now, it doesn't specify how to indicate a value. So, since the default is true, that means that excluding it won't indicate false, because… true is the default. So it must either be --helper=false or --helper false , but I tried both, and they both resulted in error false [not found]

The good news is that it did not generate a helper, because it was confused, so I still got the result I wanted :)

For the boolean options you can set it to false by prepending a --no_

Example:

rails generate controller book --no_helper

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