[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Extending Erubis

Alexey Petrushin

9/20/2008 12:04:00 AM

Hello!

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

...
<tr>
<td>Name</td>
<td><%= @name.to_html session %></td>
</tr>
<tr>
<td>Completed</td>
<td><%= @completed.to_html session %></td>
</tr>
...

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! :)
--
Posted via http://www.ruby-....