opal / opal-haml

Opal + Haml = <3
MIT License
23 stars 5 forks source link

Uncaught NoMethodError: undefined method `buffer' for #<Template::OutputBuffer:77> #3

Closed rubydesign closed 9 years ago

rubydesign commented 9 years ago

Hi, i get this when i try with the latest gem*

the haml is simple: .col-md-12 %a{:href => '/manage/report'} Reports

my opal/js in rails app is (shortened) require "link" Template["link"].render

I think this must be a versioning thing. When i try with erb it work. Also the example works when i switch to all github versions. But the haml github agains the gems does not work (as per readme)

Probably will solve itself soon. I had another interesting thing when i misspelled the href in the template. Then i got undefined << for the same OutputBuffer. Try it. I looked at writing the spec for it, but i am very new...

So, a few random observation, but mainly i am impressed. Good going!! T.

adambeynon commented 9 years ago

Hi! The issue is that opal-haml isn't being loaded properly. It should be implicit when you require a haml template. Until I can check on a fix, this should work for you:

require "link"
require "opal-haml"   # provides OutputBuffer extensions
Template["link"].render
rubydesign commented 9 years ago

ok, cool.