Skip to content

Commit 8b44321

Browse files
authored
Merge pull request rails#51239 from jherdman/tweak-tag-helper-docs [ci-skip]
More complicated tag helper example
2 parents f735328 + 09e8eb4 commit 8b44321

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

actionview/lib/action_view/helpers/tag_helper.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,14 @@ def method_missing(called, *args, escape: true, **options, &block)
420420
# # A void element:
421421
# tag.br # => <br>
422422
#
423+
# Note that when using the block form options should be wrapped in
424+
# parenthesis.
425+
#
426+
# <%= tag.a(href: "/about", class: "font-bold") do %>
427+
# About the author
428+
# <% end %>
429+
# # => <a href="/about" class="font-bold">About the author</a>
430+
#
423431
# === Building HTML attributes
424432
#
425433
# Transforms a Hash into HTML attributes, ready to be interpolated into

0 commit comments

Comments
 (0)