It seems that I am stuck figuring out so that my generator doesn't need an argument. So for instance my generator code is this:
class MyGenerator < Rails::Generators::NamedBase
source_root File.expand_path('../templates', __FILE__)
def generate_stylesheet
copy_file "my.css", "public/stylesheets/my.css"
end
end
But when I do rails g my
rails always asks for an extra argument. Can you show me how so it doesn't need an extra argument?
Thanks.
You have to use class MyGenerator < Rails::Generators::Base
instead of class MyGenerator < Rails::Generators::NamedBase
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