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 %>
精彩评论