Skip to content

Instantly share code, notes, and snippets.

@nickhoffman
Created January 24, 2012 00:01
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 nickhoffman/1666614 to your computer and use it in GitHub Desktop.
Save nickhoffman/1666614 to your computer and use it in GitHub Desktop.
Nesting text within a content tag.
# The HTML that should be generated is:
# <h3 class="curated_by">Curated by <span>Bob</span></h3>
# Please tell me that there's a better way to do this.
def curated_by
html = ''
html += h.content_tag(:h3, :class => 'curated_by') do
h.concat h.t('phrases.Curated_by')
h.concat ' '
h.concat h.content_tag(:span, curator_username)
end.html_safe
html.html_safe
end
@victorbstan
Copy link

The ideology of perfection is crippling though, isn't it?

@nickhoffman
Copy link
Author

Hah yeah, it is.

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