lib/yaks/format/html.rb in yaks-html-0.6.2 vs lib/yaks/format/html.rb in yaks-html-0.7.0

- old
+ new

@@ -45,26 +45,27 @@ ->(templ) do links.map do |link| templ .replace('.rel a') {|a| a.attr('href', link.rel.to_s).content(link.rel.to_s) } .replace('.uri a') {|a| a.attr('href', link.uri).content(link.uri) } - .replace('.title') {|x| x.content(link.title) } + .replace('.title') {|x| x.content(link.title.to_s) } .replace('.templated') {|x| x.content(link.templated?.inspect) } end end end def render_subresources(resource, templ, sub_templ) templ = templ.replace('h1,h2,h3,h4') {|h| h.set_tag("h#{h.tag[/\d/].to_i.next}") } if resource.collection? - resource.map do |r| + resource.seq.map do |r| render_resource(r, templ) end else - resource.subresources.map do |rel, resources| + resource.subresources.map do |resources| + rel = resources.rels.first.to_s sub_templ - .replace('.rel a') {|a| a.attr('href', rel.to_s).content(rel.to_s) } - .replace('.value') {|x| x.content(resources.map { |resource| render_resource(resource, templ) })} + .replace('.rel a') {|a| a.attr('href', rel).content(rel) } + .replace('.value') {|x| x.content(resources.seq.map { |resource| render_resource(resource, templ) })} end end end