instance method
generate
Ruby on Rails 7.2.3
Since v3.0.20Signature
generate(what, *args)
Runs another generator.
generate "scaffold", "Post title:string body:text" generate "scaffold", "Post", "title:string", "body:text"
The first argument is the generator name, and the remaining arguments are joined together and passed to the generator.
Parameters
-
whatreq -
argsrest
Source
# File railties/lib/rails/generators/actions.rb, line 332
def generate(what, *args)
log :generate, what
options = args.extract_options!
options[:abort_on_failure] = !options[:inline]
rails_command "generate #{what} #{args.join(" ")}", options
end
Defined in railties/lib/rails/generators/actions.rb line 332
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Actions