Skip to content

Commit

Permalink
Use interpolation in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Jan 2, 2019
1 parent 6dd2d00 commit 2c00a6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/rails/helper_instance_variable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ module Rails
# @example
# # bad
# def welcome_message
# "Hello " + @user.name
# "Hello #{@user.name}"
# end
#
# # good
# def welcome_message(user)
# "Hello " + user.name
# "Hello #{user.name}"
# end
class HelperInstanceVariable < Cop
MSG = 'Do not use instance variables in helpers.'.freeze
Expand Down
4 changes: 2 additions & 2 deletions manual/cops_rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -825,12 +825,12 @@ example to a model, decorator or presenter.
```ruby
# bad
def welcome_message
"Hello " + @user.name
"Hello #{@user.name}"
end

# good
def welcome_message(user)
"Hello " + user.name
"Hello #{user.name}"
end
```

Expand Down

0 comments on commit 2c00a6b

Please sign in to comment.