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 genera开发者_运维技巧te_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
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论