gma / nesta

File Based CMS and Static Site Generator
http://nestacms.com
MIT License
902 stars 121 forks source link

helpers not working in content page #10

Closed rayngwf closed 13 years ago

rayngwf commented 14 years ago

helpers seems not working in content/ page but work in views/, local/, themes/.

gma commented 14 years ago

Thanks for the report. Were you using them in a .haml content page? I don't think I've ever tried to use them like that.

If I've understood your problem correctly, I think the fix will be to pass a scope object through to Haml. Have a look at how Glenn is doing it in these two files:

http://github.com/rubypond/nesta/blob/master/views/page.haml#L16 http://github.com/rubypond/nesta/blob/master/lib/models.rb#L68

I never merged this change in because he never got round to sending me a pull request with a test, but if this sorts your problem out then I might just cook up a test myself.

If you try it, I'd appreciate it if you'd let me know what happens. Cheers.

rayngwf commented 14 years ago

Great job. It works for me now.

gma commented 14 years ago

Thanks.

gma commented 13 years ago

This has now been fixed (sorry folks, I thought I'd already committed this). See https://github.com/gma/nesta/commit/9f818e20f208d68580cef9179cc36550d11fd2a3