From 4bfa69a78578c52cf5bfaae9e30b54f83096f7ed Mon Sep 17 00:00:00 2001 From: Jonathan Hefner Date: Fri, 24 Nov 2023 17:19:47 -0600 Subject: [PATCH] Revise TextHelper#concat code example [ci-skip] This simplifies the code example, and avoids putting `%>` _inside_ an ERB tag, which confuses the syntax highlighter. --- .../lib/action_view/helpers/text_helper.rb | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/actionview/lib/action_view/helpers/text_helper.rb b/actionview/lib/action_view/helpers/text_helper.rb index 994894043d592..d9a63b92b3d58 100644 --- a/actionview/lib/action_view/helpers/text_helper.rb +++ b/actionview/lib/action_view/helpers/text_helper.rb @@ -46,17 +46,20 @@ module TextHelper # output text within a non-output code block (i.e., <% %>), you # can use the +concat+ method. # + # <% concat "hello" %> is equivalent to <%= "hello" %> + # # <% - # concat "hello" - # # is the equivalent of <%= "hello" %> - # - # if logged_in - # concat "Logged in!" - # else - # concat link_to('login', action: :login) - # end - # # will either display "Logged in!" or a login link + # unless signed_in? + # concat link_to("Sign In", action: :sign_in) + # end # %> + # + # is equivalent to + # + # <% unless signed_in? %> + # <%= link_to "Sign In", action: :sign_in %> + # <% end %> + # def concat(string) output_buffer << string end