cloudhead / cloudhead/toto

render partials with haml

Open
#28 3 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
Ruby
Stars
1.5k
Forks
240
PR merge metrics
No merged PRs in 30d

Description

I would love to use partials within haml. However, when I try to render a partial, the to_html method fails. What do I need to add to the render call?

=render :partial=> "sidebar"

give's me an ArgumentError, wrong number of arguments (1 for 2)
# /Library/Ruby/Gems/1.8/gems/toto-0.4.1/lib/toto.rb: in to_html
1. def self.env= env
2. ENV['RACK_ENV'] = env
3. end
29.
4. module Template
5. def to_html page, config, &blk
6. path = ([:layout, :repo].include?(page) ? Paths[:templates] : Paths[:pages])
7. config[:to_html].call(path, page, binding)...
8. end
35.
9. def markdown text
10. if (options = @config[:markdown])
11. Markdown.new(text.to_s.strip, *(options.eql?(true) ? [] : options)).to_html
12. else
13. text.strip

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.