Skip to content

Instantly share code, notes, and snippets.

@midu
Created February 17, 2012 19:53
Show Gist options
  • Select an option

  • Save midu/1855104 to your computer and use it in GitHub Desktop.

Select an option

Save midu/1855104 to your computer and use it in GitHub Desktop.
<%= @submissions_presenter.render_unless_draft(submission) do %>
<%= 'kikou chrissou' %>
<% end %>
def render_unless_draft(submission, &block)
if submission.draft?
content_tag :span, :class => 'tag grey' do
'draft'
end
else
capture(&block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment