diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-07-02 03:25:48 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-02 03:25:48 +0900 |
commit | 60e19c6d6cb60159af4e2247f29d2cea375a21d6 (patch) | |
tree | d69e3806f7487b89b83e4261935cdff00dfa9110 | |
parent | 72e257b4c935b6829f7d4db36dea61a1682aa44e (diff) | |
parent | 63a863476ae4bcf2ddc15a8c112abfe58abf6a15 (diff) | |
download | rails-60e19c6d6cb60159af4e2247f29d2cea375a21d6.tar.gz rails-60e19c6d6cb60159af4e2247f29d2cea375a21d6.tar.bz2 rails-60e19c6d6cb60159af4e2247f29d2cea375a21d6.zip |
Merge pull request #36582 from f1337/master
[skip ci] use 'template' instead of 'create_file' for erb templates in generators guide
-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 |