instance method
generate
Ruby on Rails 6.0.6
Since v3.0.20Signature
generate(what, *args)
Generate something using a generator from Rails or a plugin. The second parameter is the argument string that is passed to the generator or an Array that is joined.
generate(:authenticated, "user session")
Parameters
-
whatreq -
argsrest
Source
# File railties/lib/rails/generators/actions.rb, line 221
def generate(what, *args)
log :generate, what
options = args.extract_options!
options[:without_rails_env] = true
argument = args.flat_map(&:to_s).join(" ")
execute_command :rails, "generate #{what} #{argument}", options
end
Defined in railties/lib/rails/generators/actions.rb line 221
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Actions