Reputation: 13
How can I add span tags to the following link?
<%= link_to 'demo', :action => 'test', :path => '' %>
Should display like this:
<a href="/test"><span>demo</span></a>
Upvotes: 1
Views: 199
Reputation: 7899
or you can use link_to content_tag(:span, "demo"),:action => 'test', :path => ''
Upvotes: 1
Reputation: 9818
<% link_to :action => 'test', :path => '' do %>
<span>demo</span>
<% end %>
Upvotes: 7
Reputation: 5527
<%= link_to '<span>demo</span>', :action => 'test', :path => '' %>
Upvotes: 3