Skip to content

Commit

Permalink
Merge pull request #36582 from f1337/master
Browse files Browse the repository at this point in the history
[skip ci] use 'template' instead of 'create_file' for erb templates in generators guide
  • Loading branch information
kamipo committed Jul 1, 2019
2 parents 72e257b + 63a8634 commit 60e19c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guides/source/generators.md
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 60e19c6

Please sign in to comment.