A
Adam Van Den Hoven
Hey guys,
I've been dabbling with ruby on and off for a year or so and recently
more often. At work we do Java development and I keep thinking that
it would be nice to be able to bring some of the stuff I designed
there into my own work, which I want to do in ruby.
I was wondering if anyone had thought about adding something like the
Java TagLibs to ruby (I guess it would embedded ruby). In my case, it
would make long term maintenance of files MUCH easier as I can give
it to a non-technical person without much documentation. In most
cases people who don't understand programming do understand parts of
HTML markup. If I could hide what is currently inline code behind
things that look like tags, its easier to give maintenance over to
non-technical folks.
Here's a simple example. Often you want to do tiger striping on
tables (alternate background color on each row). Because there isn't
sufficiently wide spread support for CSS2 and CSS3 selectors, you
tend to do the following:
<table>
<tr class="odd"><td>...</td></tr>
<tr class="even"><td>...</td></tr>
<tr class="odd"><td>...</td></tr>
<tr class="even"><td>...</td></tr>
<tr class="odd"><td>...</td></tr>
<tr class="even last"><td>...</td></tr>
</table>
Unfortunately, if you want to add something between rows 4 and 5 you
need to reset all your classes. This can get complicated. However, if
I had a taglib I could ask my content authors to write the following:
<av:table>
<av:trow><td>...</td></av:trow >
<av:trow><td>...</td></av:trow >
<av:trow><td>...</td></av:trow >
<av:trow><td>...</td></av:trow >
<av:trow><td>...</td></av:trow >
<av:trow><td>...</td></av:trow >
</av:table>
And leave the generation up to the code.
I can think of hundreds of specific tags I might create, depending on
the situation, which would make authoring content easier and would
give me better control over the rendering of a page. It could also
make writing code easier in general. It would also be useful to have
many of the tags defined in the JSTL.
Just a thought I had.
Adam
I've been dabbling with ruby on and off for a year or so and recently
more often. At work we do Java development and I keep thinking that
it would be nice to be able to bring some of the stuff I designed
there into my own work, which I want to do in ruby.
I was wondering if anyone had thought about adding something like the
Java TagLibs to ruby (I guess it would embedded ruby). In my case, it
would make long term maintenance of files MUCH easier as I can give
it to a non-technical person without much documentation. In most
cases people who don't understand programming do understand parts of
HTML markup. If I could hide what is currently inline code behind
things that look like tags, its easier to give maintenance over to
non-technical folks.
Here's a simple example. Often you want to do tiger striping on
tables (alternate background color on each row). Because there isn't
sufficiently wide spread support for CSS2 and CSS3 selectors, you
tend to do the following:
<table>
<tr class="odd"><td>...</td></tr>
<tr class="even"><td>...</td></tr>
<tr class="odd"><td>...</td></tr>
<tr class="even"><td>...</td></tr>
<tr class="odd"><td>...</td></tr>
<tr class="even last"><td>...</td></tr>
</table>
Unfortunately, if you want to add something between rows 4 and 5 you
need to reset all your classes. This can get complicated. However, if
I had a taglib I could ask my content authors to write the following:
<av:table>
<av:trow><td>...</td></av:trow >
<av:trow><td>...</td></av:trow >
<av:trow><td>...</td></av:trow >
<av:trow><td>...</td></av:trow >
<av:trow><td>...</td></av:trow >
<av:trow><td>...</td></av:trow >
</av:table>
And leave the generation up to the code.
I can think of hundreds of specific tags I might create, depending on
the situation, which would make authoring content easier and would
give me better control over the rendering of a page. It could also
make writing code easier in general. It would also be useful to have
many of the tags defined in the JSTL.
Just a thought I had.
Adam