Skip to content

Instantly share code, notes, and snippets.

@mislav
Created October 17, 2008 07:42
Show Gist options
  • Save mislav/17371 to your computer and use it in GitHub Desktop.
Save mislav/17371 to your computer and use it in GitHub Desktop.
haml2erb
class ErbEngine < Haml::Engine
def push_script(text, preserve_script, in_tag = false, preserve_tag = false,
escape_html = false, nuke_inner_whitespace = false)
push_text "<%= #{text.strip} %>"
end
def push_silent(text, can_suppress = false)
push_text "<% #{text.strip} %>"
end
end
<<<<<<<<<<<<< IN:
#moo
= some('Ruby Codez')
%span.foo Bar
- for spartan in warriors
%q= spartan.profession
-------------
<div id='moo'>
<%= some('Ruby Codez') %>
<span class='foo'>Bar</span>
<% for spartan in warriors %>
<q> <%= spartan.profession %>
</q>
<% end %>
</div>
>>>>>>>>>>>>> OUT
@pycckuu
Copy link

pycckuu commented Mar 14, 2013

%form
= label :user, :email, "Email"
= text_field :user, :email
= label :user, :password
= password_field :user, :password
%input{:type => "submit", :value => "Sign in"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment