开发者

HTML Rails View Format Question

How would I produce something like this in Rails ERB?

<li><a href="portfolio.html">Portfolio <span>Our work</span></a>

My problem is that ruby won't allow me to span inside of the link.

<%= link_to 'portfolio', portfolio_path %>

Anyway to get the Our Works Span inside of that link?

Thanks in Advance.

Solved

<% link_to portfolio_path do %> Portfolio <span>Our开发者_Python百科 work</span> <% end %>


You could put the HTML string right in there like this:

<%= link_to 'Portfolio <span>Our work</span>', portfolio_path %>

Or, you can pass a block to enclose the link:

<% link_to portfolio_path do %>
Portfolio <span>Our work</span>
<% end %>


You can try something like this:


<%= link_to 'Porfolio <span>Our Work</span>', portfolio_path %>

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜