Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to insert special HTML-symbols with HAML

When I'm saying:

%p= item.price + " dollars" 

I'm getting

50&nbsp ;dollars

instead of having non-breakable space symbol.

How to insert this and another special symbols using HAML ?

like image 221
AntonAL Avatar asked Jun 10 '11 11:06

AntonAL


People also ask

How do you write HAML in HTML?

In Haml, we write a tag by using the percent sign and then the name of the tag. This works for %strong , %div , %body , %html ; any tag you want. Then, after the name of the tag is = , which tells Haml to evaluate Ruby code to the right and then print out the return value as the contents of the tag.

What is a HTML HAML file?

Haml (HTML Abstraction Markup Language) is a templating system that is designed to avoid writing inline code in a web document and make the HTML cleaner. Haml gives the flexibility to have some dynamic content in HTML.

How do you represent in HTML?

HTML Symbol Entities To add such symbols to an HTML page, you can use the entity name or the entity number (a decimal or a hexadecimal reference) for the symbol.


1 Answers

How about

%p= item.price + " dollars".html_safe 
like image 88
HakonB Avatar answered Sep 22 '22 17:09

HakonB