diff options
author | Michael R Fleet <f1337@f1337.us> | 2019-07-01 13:47:53 -0400 |
---|---|---|
committer | Michael R Fleet <f1337@f1337.us> | 2019-07-01 13:47:53 -0400 |
commit | 63a863476ae4bcf2ddc15a8c112abfe58abf6a15 (patch) | |
tree | d69e3806f7487b89b83e4261935cdff00dfa9110 /guides | |
parent | 72e257b4c935b6829f7d4db36dea61a1682aa44e (diff) | |
download | rails-63a863476ae4bcf2ddc15a8c112abfe58abf6a15.tar.gz rails-63a863476ae4bcf2ddc15a8c112abfe58abf6a15.tar.bz2 rails-63a863476ae4bcf2ddc15a8c112abfe58abf6a15.zip |
use 'template' instead of 'create_file' for erb templates in generators guide [skip ci]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/generators.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/generators.md b/guides/source/generators.md index 88ce4be8da..cd8fbede17 100644 --- a/guides/source/generators.md +++ b/guides/source/generators.md @@ -252,7 +252,7 @@ Add the method below, so our generator looks like the following: # lib/generators/rails/my_helper/my_helper_generator.rb class Rails::MyHelperGenerator < Rails::Generators::NamedBase def create_helper_file - create_file "app/helpers/#{file_name}_helper.rb", <<-FILE + template "app/helpers/#{file_name}_helper.rb", <<-FILE module #{class_name}Helper attr_reader :#{plural_name}, :#{plural_name.singularize} end @@ -307,7 +307,7 @@ To do that, we can change the generator this way: # lib/generators/rails/my_helper/my_helper_generator.rb class Rails::MyHelperGenerator < Rails::Generators::NamedBase def create_helper_file - create_file "app/helpers/#{file_name}_helper.rb", <<-FILE + template "app/helpers/#{file_name}_helper.rb", <<-FILE module #{class_name}Helper attr_reader :#{plural_name}, :#{plural_name.singularize} end |