Extending Erubis

A

Alexey Petrushin

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! :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,048
Members
47,651
Latest member
VeraPiw932

Latest Threads

Top