John Abraham
John Abraham

Reputation: 18771

Haml wont allow erb output to render

I have two templates

test.html.haml test.html.erb

both have the same content

<%= 1+1 %>

output for haml (wrong)

%= 1+1 %>

output for erb (correct

2

how do I get the haml file to allow ruby output

Upvotes: 0

Views: 84

Answers (3)

Arup Rakshit
Arup Rakshit

Reputation: 118261

Look here How to Convert

ERB

<strong><%= item.title %></strong>

Haml

%strong= item.title

Upvotes: 0

Gareth
Gareth

Reputation: 138012

If you want a HAML file instead of a eRB file, you need to use HAML syntax instead of eRB syntax:

= 1 + 1

Upvotes: 1

Jared Beck
Jared Beck

Reputation: 17528

If I understand correctly, you have a haml file with the following content:

<%= 1+1 %>

That is ERB syntax, you need to use HAML syntax.

= 1 + 1

Upvotes: 1

Related Questions