Skip to content

Instantly share code, notes, and snippets.

View JuzerShakir's full-sized avatar
🎯
Focusing

Juzer Shakir JuzerShakir

🎯
Focusing
View GitHub Profile
@abhilashak
abhilashak / nested_content_snippet.rb
Last active October 28, 2023 21:06 — forked from bunnymatic/nested_content_snippet.rb
Nested content tags in rails 5 view helpers
# because i can never remember exactly how and when to use concat
# when building content in helpers
def nested_content
content_tag 'div' do
concat(content_tag 'span', 'span block')
concat(tag 'br')
concat(link_to 'root link', root_path)
concat(tag 'br')
concat(link_to('#') do
concat(content_tag 'h2', 'Head \'em off')