提交 46a4ac8a 编写于 作者: M maciej-ka

docs: add example for a nil name in link_to

上级 19d2fab6
......@@ -139,6 +139,11 @@ def _filtered_referrer # :nodoc:
# link_to "Profiles", controller: "profiles"
# # => <a href="/profiles">Profiles</a>
#
# When name is +nil+ the href is presented instead
#
# link_to nil, "http://example.com"
# # => <a href="http://www.example.com">http://www.example.com</a>
#
# You can use a block as well if your link target is hard to fit into the name parameter. ERB example:
#
# <%= link_to(@profile) do %>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册