Permalink
Browse files

block() can now accept content as a String, as well as a block

  • Loading branch information...
1 parent 7b55413 commit ad889309744ed0b909dfa6c315d7f5f707580fde @justinfrench justinfrench committed Apr 27, 2011
Showing with 3 additions and 5 deletions.
  1. +3 −5 app/helpers/nestive/layout_helper.rb
@@ -111,11 +111,9 @@ def extends(name, &block)
#
# @param [Symbol] name
# A unique name to identify this block of content.
- #
- # @todo
- # Just realised that this methods doesn't accept a String, only a block.
- def block(name, &block)
- append(name, &block)
+ def block(name, content=nil, &block)
+ content = capture(&block) if block_given?
+ append(name, content)
render_block(name)
end

0 comments on commit ad88930

Please sign in to comment.