Skip to content

Commit 2c00a6b

Browse files
committed
Use interpolation in examples
1 parent 6dd2d00 commit 2c00a6b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/rubocop/cop/rails/helper_instance_variable.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ module Rails
1616
# @example
1717
# # bad
1818
# def welcome_message
19-
# "Hello " + @user.name
19+
# "Hello #{@user.name}"
2020
# end
2121
#
2222
# # good
2323
# def welcome_message(user)
24-
# "Hello " + user.name
24+
# "Hello #{user.name}"
2525
# end
2626
class HelperInstanceVariable < Cop
2727
MSG = 'Do not use instance variables in helpers.'.freeze

manual/cops_rails.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,12 +825,12 @@ example to a model, decorator or presenter.
825825
```ruby
826826
# bad
827827
def welcome_message
828-
"Hello " + @user.name
828+
"Hello #{@user.name}"
829829
end
830830

831831
# good
832832
def welcome_message(user)
833-
"Hello " + user.name
833+
"Hello #{user.name}"
834834
end
835835
```
836836

0 commit comments

Comments
 (0)