how do i link my Logo which is made out of Text and CSS to my root_path and the inside of it?
This is how it would l开发者_开发百科ook without Rails:
<h1><a href=#>Main Title<span>subtitle</span></a></h1>
I am using no images and just plain CSS text for the Logo.
Thank you!
If you mean link to root page:
<h1><%= link_to 'Main Title<span>subtitle</span>'.html_safe, '/' %></h1>
If you want other locations and have some resources set up, you could use paths:
<h1><%= link_to 'Main Title<span>subtitle</span>'.html_safe, example_path %></h1>
If you happen to need even more HTML markup in the link, then check this question out:
- How do I wrap link_to around some html ruby code?
精彩评论