Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Custom Captures

DZone's Guide to

Custom Captures

·
Free Resource
I made a layout with some slightly ugly code for making rounded boxes with CSS and HTML, and wanted a way to automate the boxes. I had thought of having two functions to print starting and ending code, but this seems nicer.

This goes with the other application helpers:


  def rounded_box(█)
    concat '
  
' + capture(█) + '
', block.binding end
This goes in a view: <% rounded_box do %> ... stuff to put in the rounded box ... <% end %>
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}