I’m trying out my first website in rails and i’m trying to creating a link that ultimately looks like this:
<a href="home_controller"><span>Home</span></a>
This produces my desired output, but is there a more refactored way to write this?
<%= link_to :controller => "home" do %>
<span>Home</span>
<% end %>
I mean the only other way you could do it would be as follows:
but I’m not sure that is any better, short isn’t any better, and I think your solution is really the best, most clear way to express your intent.