Skip to content
Browse files

Added html element that captures block

  • Loading branch information...
1 parent 4e9a5fc commit baf18af862bbe5a44392dab8dee2bb51288ba1dd @mateomurphy committed
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

0 comments on commit baf18af

Please sign in to comment.
Something went wrong with that request. Please try again.