adding attributes to open_tag
git-svn-id: svn://hamptoncatlin.com/haml/trunk@404 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
97732c5bc4
commit
f92025c7fa
|
@ -79,8 +79,10 @@ if action_view_included
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# TODO: Make it output with better tabulation
|
# TODO: Make it output with better tabulation
|
||||||
def open_tag(named, &block)
|
def open_tag(named, options = {}, &block)
|
||||||
push_text "<#{named}>"
|
# TODO: I'm sure re-coding this is bad. I know we do this elsewhere, obviously.
|
||||||
|
attributes = (options.collect { |key, value| "#{key}='#{value}'" }).join(" ")
|
||||||
|
push_text "<#{named}#{attributes}>"
|
||||||
tab_up
|
tab_up
|
||||||
block.call
|
block.call
|
||||||
concat "\n"
|
concat "\n"
|
||||||
|
|
Loading…
Reference in New Issue