开发者

How do I specify a span tag as the 'Name' of the link, in the link_to helper in Rails 3?

开发者 https://www.devze.com 2023-02-22 00:58 出处:网络
So my link_to looks like: <%= link_to compare_stage_path(stage, :access_key => client.authentication_token) %>

So my link_to looks like:

<%= link_to compare_stage_path(stage, :access_key => client.authentication_token) %>

But I would like to make the following span the link that links to the above path:

<span class='edit-icon'> </span>

How do I do开发者_如何学Python that ?


If I understand correctly, you want that span tag as the content of the anchor element for the link, right? In that case...

<%= link_to "<span class='edit-icon'> </span>".html_safe,
            compare_stage_path(stage, :access_key => client.authentication_token) %>
0

精彩评论

暂无评论...
验证码 换一张
取 消