Skip to content

Instantly share code, notes, and snippets.

@grindars
Created August 18, 2013 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grindars/6262076 to your computer and use it in GitHub Desktop.
Save grindars/6262076 to your computer and use it in GitHub Desktop.
view(:local_variable => "a", :cond => false) do
~ div do
~ local_variable
end
~ content_tag("span")
if cond
~ div("true")
else
~ div("false")
end
~ div("hi")
end
@gzigzigzeo
Copy link

haml do
  %div
     = local_variable
  %span
  - if cond
     %div true
  - else
     %div false
end

?

@gzigzigzeo
Copy link

I do not cleanly understand why to develop yet another markup language. In one hand, it simplifies inserting templates into controller. In other hand, even bit view code in controller is an evil. Mixing MVC levels is bad practice.

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