Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added html element that captures block

  • Loading branch information...
commit baf18af862bbe5a44392dab8dee2bb51288ba1dd 1 parent 4e9a5fc
@mateomurphy authored
Showing with 15 additions and 0 deletions.
  1. +4 −0 lib/display_for/builder/base.rb
  2. +11 −0 lib/display_for/element/html.rb
View
4 lib/display_for/builder/base.rb
@@ -23,6 +23,10 @@ def action(name, options = {}, &block)
@actions << Element::Action.new(self, name, options, &block)
end
+ def html(name, options = {}, &block)
+ @attributes << Element::Html.new(self, name, options, &block)
+ end
+
end
end
end
View
11 lib/display_for/element/html.rb
@@ -0,0 +1,11 @@
+module DisplayFor
+ module Element
+ class Html < Base
+
+ def content(resource)
+ @builder.template.capture(resource, &@block)
+ end
+
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.