Exactly - i use eruby in lieu of Amrita for
presentation and/or content. Let me explain.
In a simple CMS system i’m creating, i have a ui that
allows the owner of the site to edit/create (static)
content on the fly. Then i started thinking that i’d
like to have some smarts in these files. Instead of
setting up a harnessing mechanism with Amrita, i added
a property to the content, executable, and if it is
on, i complile the text through the eruby compiler and
eval the code. Dangerous, i know, but it works
amazingly well so far. Now, I can create content as
well as logic on the fly. Right now, within these
files, the world is my oyster (read destruction zone
:).
My next step is sandboxing (perhaps safe level 4, i
dont know) and/or data injection(like Amrita) for
these files and/or only allowing developers(as opposed
to editors) to create an executable. I’ve also thot
about forcing these files thru some sort of simple
authorization process (there will be a simple work
flow anyway) where a developer/admin would need to
look at the code before it’s available/executable.
This has obvious advantages(and disadvantages), but it
also has one BIG advantage that is not immidiately
clear - i can compile the code with eruby and save
THAT, which is now pure ruby, into a supporting
table. So it is compiled only ONCE.
My view currently (it changes often :), is, why learn
a templating language when you can use eruby and some
basic but powerful ruby (for popping in vars/iterating
etc)? Keep in mind i dont expect these files to have a
lot of logic - theyre for presentation after all.
Interestingly, all of a sudden, i’m a few short steps
toward having something like zope - content/user
management, work flow, and to some extent, logic
creation from within the browser.
I’m kind of clued in to the dangers/folly of this, but
you guys out there that know better, rip me up!
PS: I’ve babbled quite a bit, I know, but since i’m
at it let me tell you a little more about the overall
system i’m building, why i started it etc.
I’m creating 3 sites currently. All for one customer.
I wanted
- To share code between them(for user and content mgt
etc)
- To be able to have a different look and feel for
each.
So the basics(it is simple!) are, for each site, i
have a config/data file(xml) and a template(eruby).
The config file holds things like what template to
use, admin email, contact info, default title/content,
toolbar items etc.
Adding a new site is trivial (one file in the root
with one line of code). It can have it’s own look and
feel or use the default. It has all the capabilities
needed to create the whole site through the browser.
The one thing missing from many of these Web
Application Platforms/Frameworks is the ability to
simply create websites - with content mgt and a common
look and feel. I’m not as interested in the webobjects
or j2ee platform/methodology as i am in creating sites
that are easy to build and maintain. For me, i guess
i’m more interested in a Web Site Platform - that i
can extend as i see fit. The above works pretty good
for me so far. I’d be interested in any constructive
crit you may have.
Paul
···
— “John W. Long” ng@johnwlong.com wrote:
----“paul vudmaska” wrote:----
something like…
<%=data['title']%>
<%=data['body']%>
...just testing what i get for data
<%
data.each do |d|
puts d
end
%>
</body>
So, leave the heavy lifting to the developer but
let
the designer play too.
This is essentially eruby.
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html