N
Noel Kelly
In the Haml tutorial has this sample:
ERB
<div id='content'>
<div class='left column'>
<h2>Welcome to our site!</h2>
<p><%= print_information %></p>
</div>
<div class="right column">
<%= render artial => "sidebar" %>
</div>
</div>
Haml
#content
.left.column
%h2 Welcome to our site!
%p= print_information
.right.column
= render artial => "sidebar"
I want to convert a similar block that includes a conditional, but can't
find/google how to do it. Is it possible?
ERB
<% if ENV["RACK_ENV"] == "production" %>
<%= render artial => "ga" %>
<% else
<div class="dev dummy">
Google Analytics in prod
</div>
<% end %>
Haml
???
Any help would be much appreciated.
ERB
<div id='content'>
<div class='left column'>
<h2>Welcome to our site!</h2>
<p><%= print_information %></p>
</div>
<div class="right column">
<%= render artial => "sidebar" %>
</div>
</div>
Haml
#content
.left.column
%h2 Welcome to our site!
%p= print_information
.right.column
= render artial => "sidebar"
I want to convert a similar block that includes a conditional, but can't
find/google how to do it. Is it possible?
ERB
<% if ENV["RACK_ENV"] == "production" %>
<%= render artial => "ga" %>
<% else
<div class="dev dummy">
Google Analytics in prod
</div>
<% end %>
Haml
???
Any help would be much appreciated.