Skip to content

Instantly share code, notes, and snippets.

@mikebaldry
Created November 11, 2011 17:05
Show Gist options
  • Select an option

  • Save mikebaldry/1358563 to your computer and use it in GitHub Desktop.

Select an option

Save mikebaldry/1358563 to your computer and use it in GitHub Desktop.
DRY my haml
-if t.incomplete?
%a{:href => lead_task_path(t.lead, t)}
=t.title
.sub= t.lead.business_name
-else
=t.title
.sub= t.lead.business_name
@mikebaldry
Copy link
Author

I ended up with this. everyone on irc ignored me. thanks guys!

-content = capture do
=t.title
.sub=t.lead.business_name

-if t.incomplete?
%a{:href => lead_task_path(t.lead, t)}=content
-else
=content

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