let’s say I have this:
link_to "Profile", profile_path(@profile)
# => <a href="/profiles/1">Profile</a>
But if I need only the href link like <a href="/profiles/1"><h1>Title</h1><p>some text</p></a> ?
Are there any rails method for doing this?
EDIT: Soluction for this was block usage like this:
<%= 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>
This was the solution:
Hope it helps someone.