[Dokkit-users] Support for partials

Craig S. Cottingham craig.cottingham at gmail.com
Wed Aug 12 01:10:57 EDT 2009


I'm having trouble figuring out how to use partials in Deplate pages.

After digging into the source code, I finally discovered that  
partials are included much as they are in Rails:

     <%= render :partial => 'name' %>

The first problem I ran into is that while an underscore is added to  
the front of the partial name, no extension is added. So I changed  
the inclusion of the partial to

     <%= render :partial => 'name.rhtml' %>

and added a file named '_name.rhtml' to the pages directory.

The second problem is that sometimes Dokkit renders the partial, and  
sometimes not. When it fails, it reports "No such file or directory -  
doc/pages/./_name", as if it is stripping off the extension from the  
filename. I *think* the render succeeds the first time after I run  
"rake clean", but then fails every time after that.

The third problem is that when the partial does render, its contents  
are being wrapped in an HTML p element, with the angle brackets  
escaped as HTML entities:

     &lt;p&gt;This is the contents of "name".&lt;/p&gt;

I suspect that this last problem has something to do with rendering  
the partial in a Deplate page rather than (say) the layout.

Any suggestions would be greatly appreciated.

--
Craig S. Cottingham
craig.cottingham at gmail.com
+1 (913) 826-6896 or Skype me at CraigCottingham
OpenPGP fingerprint: 7977F79C



More information about the Dokkit-users mailing list