私がこれを持っているとしましょう:
link_to "Profile", profile_path(@profile)
# => <a href="/profiles/1">Profile</a>
しかし、次のような href リンクだけが必要な場合は<a href="/profiles/1"><h1>Title</h1><p>some text</p></a>
?
これを行うためのレール方法はありますか?
編集:これに対する解決策は、次のようなブロックの使用法でした:
<%= link_to(@profile) do %>
<strong><%= @profile.name %></strong> -- <span>Check it out!</span>
<% end %>
# => <a href="/profiles/1">
<strong>David</strong> -- <span>Check it out!</span>
</a>