# Extending Erubis

**URL:** <https://www.ruby-forum.com/t/extending-erubis/149080>\
**Category:** Ruby\
**Created:** [September 20, 2008, 2:11am UTC](https://www.ruby-forum.com/t/extending-erubis/149080 "2008-09-20T02:11:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![axyd80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/82dd89/32.png) [@axyd80](https://www.ruby-forum.com/u/axyd80)\
**Post date:** [September 20, 2008, 2:11am UTC](https://www.ruby-forum.com/t/extending-erubis/149080/1 "2008-09-20T02:11:38Z")

</div>

Hello!

I’m developing Web-framework, and have problem, my templates looks like:

…

 Name \<%= @name.to\_html session %\> Completed \<%= @completed.to\_html session %\> ...

The problem is - I tired typing all this:  
\<%= @component\_name.to\_html session %\>  
and wondering is there any way to shortcut it to something like:  
@component\_name  
and Template Engine should then add all missing “.to\_html session” and  
process further.

At the worst I can parse raw file by RegExp and replace all this things  
before Template Engine, but hope there is more intelligent solution.

Thanks! 🙂
