# Adding Custom templates?

**URL:** <https://www.ruby-forum.com/t/adding-custom-templates/55688>\
**Category:** Rails\
**Created:** [March 22, 2006, 11:39pm UTC](https://www.ruby-forum.com/t/adding-custom-templates/55688 "2006-03-22T23:39:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [March 22, 2006, 11:39pm UTC](https://www.ruby-forum.com/t/adding-custom-templates/55688/1 "2006-03-22T23:39:00Z")

</div>

Hi, does anybody have any pointers on where to look to learn how to  
write custom dynamic templates? Agile is a little sparse on this (but  
otherwise superb)!

Thanx

---

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [March 22, 2006, 11:58pm UTC](https://www.ruby-forum.com/t/adding-custom-templates/55688/2 "2006-03-22T23:58:44Z")

</div>

James McCarthy wrote:

> Hi, does anybody have any pointers on where to look to learn how to  
> write custom dynamic templates? Agile is a little sparse on this (but  
> otherwise superb)!

Which part do you want to learn about? Writing pages in (X)HTML,  
hooking templates into Rails, or using ERb (Embedded Ruby) to  
dynamically generate HTML? Or partials, layouts, helpers, etc? Writing  
view templates is a pretty broad topic.

This recent article might be a good starting point if you are a web  
designer:  
[http://glu.ttono.us/articles/2006/03/21/rails-for-designers](http://glu.ttono.us/articles/2006/03/21/rails-for-designers)

–josh  
[http://blog.hasmanythrough.com](http://blog.hasmanythrough.com)

---

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [March 23, 2006, 12:09am UTC](https://www.ruby-forum.com/t/adding-custom-templates/55688/3 "2006-03-23T00:09:21Z")

</div>

Josh S. wrote:

> Which part do you want to learn about? Writing pages in (X)HTML,  
> hooking templates into Rails, or using ERb (Embedded Ruby) to  
> dynamically generate HTML? Or partials, layouts, helpers, etc? Writing  
> view templates is a pretty broad topic.

Sorry Josh I wasn’t specific enough, less haste…

I was looking to write a rails template handler as I am having to write  
multiple cascading partials and the whole thing is becomming rather  
messy and un-DRY.

So in a nutshell “how do I write custom rails template handlers”.

Thanks.

---

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [March 23, 2006, 12:27am UTC](https://www.ruby-forum.com/t/adding-custom-templates/55688/4 "2006-03-23T00:27:08Z")

</div>

James McCarthy wrote:

> I was looking to write a rails template handler as I am having to write  
> multiple cascading partials and the whole thing is becomming rather  
> messy and un-DRY.
> 
> So in a nutshell “how do I write custom rails template handlers”.

Oh, that’s an equine in a different band of the visual spectrum. I  
haven’t found much docs on that (and I’ve looked). Probably the best  
thing to do is to look at existing examples, like Markaby and RCSS (on  
[rubyforge.org](http://rubyforge.org)). And there is a small example in the Rails sources  
tests:  
rails/actionpack/test/controller/custom\_handler\_test.rb

–josh  
[http://blog.hasmanythrough.com](http://blog.hasmanythrough.com)

---

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [March 23, 2006, 12:44am UTC](https://www.ruby-forum.com/t/adding-custom-templates/55688/5 "2006-03-23T00:44:29Z")

</div>

> > So in a nutshell “how do I write custom rails template handlers”.
> 
> Oh, that’s an equine in a different band of the visual spectrum. I  
> haven’t found much docs on that (and I’ve looked). Probably the best  
> thing to do is to look at existing examples, like Markaby and RCSS (on  
> [rubyforge.org](http://rubyforge.org)). And there is a small example in the Rails sources  
> tests:  
> rails/actionpack/test/controller/custom\_handler\_test.rb
> 
> –josh  
> [http://blog.hasmanythrough.com](http://blog.hasmanythrough.com)

Thanks josh, will give them a gander.

---

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [March 23, 2006, 12:27am UTC](https://www.ruby-forum.com/t/adding-custom-templates/55688/6 "2006-03-23T00:27:19Z")

</div>

James McCarthy wrote:

> I was looking to write a rails template handler as I am having to write  
> multiple cascading partials and the whole thing is becomming rather  
> messy and un-DRY.
> 
> So in a nutshell “how do I write custom rails template handlers”.

Oh, that’s an equine in a different band of the visual spectrum. I  
haven’t found much docs on that (and I’ve looked). Probably the best  
thing to do is to look at existing examples, like Markaby and RCSS (on  
[rubyforge.org](http://rubyforge.org)). And there is a small example in the Rails sources  
tests:  
rails/actionpack/test/controller/custom\_handler\_test.rb

–josh  
[http://blog.hasmanythrough.com](http://blog.hasmanythrough.com)
