Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Joseph Hall
10,865 PointsHow to include HTML Symbols in Erb output tags
Hi Everyone!
I am working on a project that involves some pagination.
My code is below. How do I include html symbols in the Erb output tags.
<h4><%= link_to "Next Page →", params.merge(page: @projects.next_page), class: "pagination-link next" %></h4>
Regards, Joseph
1 Answer
Stone Preston
42,016 PointsIm not sure I understand your question. What do you mean by include html symbols in the erb tag. You might be able to pass an html option as an additional parameter using:
html: { class: "whatever" }
Can you clarify what you mean
Joseph Hall
10,865 PointsJoseph Hall
10,865 PointsHi Stone!
What I mean is how can I include a HTML symbol like → or   in link_to?
Stone Preston
42,016 PointsStone Preston
42,016 PointsDid you try just putting it inside the link_to string.
Stone Preston
42,016 PointsStone Preston
42,016 PointsTry escaping it with \ and see if that works