开发者

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

开发者 https://www.devze.com 2022-12-15 20:33 出处:网络
How can I add span tags to the following link in ruby? <%= link_t开发者_C百科o l(:label_demo), {:action => \'test\', :class => \'link\' %>

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

精彩评论

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