开发者

How to add span tags to this link type in Ruby?

How can I add span tags to the following link in ruby?

<%= link_t开发者_C百科o l(:label_demo), {:action => 'test', :class => 'link' %>


You can give the link_to function a block as an argument where you can put whatever you want to sit between the <a> and </a>.

Check out this: http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html and this http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html for more information on the link_to and tag functions.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜