I have an href tag <li><a href="/"><span></span>Home</a></li> Which i need to convert to <li> <%= link_to('Home', '/Home/') %></li> But when I enter <span></span> it reads an error. How do i enter <span></span> . So that its the same as href tag above ? <span></span> needs to be there as it is a css fix ?

thanks

有帮助吗?

解决方案

You can put the <span></span> in your first argument, so link_to '<span></span>Home', '/' should give you exactly what you want.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top