aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators.rb')
-rw-r--r--railties/lib/rails/generators.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb
index 5e8cebc50a..caf8a33c3c 100644
--- a/railties/lib/rails/generators.rb
+++ b/railties/lib/rails/generators.rb
@@ -272,8 +272,10 @@ module Rails
else
options = sorted_groups.flat_map(&:last)
suggestion = Rails::Command::Spellchecker.suggest(namespace.to_s, from: options)
+ suggestion_msg = "Maybe you meant #{suggestion.inspect}?" if suggestion
+
puts <<~MSG
- Could not find generator '#{namespace}'. Maybe you meant #{suggestion.inspect}?
+ Could not find generator '#{namespace}'. #{suggestion_msg}
Run `rails generate --help` for more options.
MSG
end