-
Notifications
You must be signed in to change notification settings - Fork 0
Feature Planning
biv edited this page Sep 13, 2010
·
5 revisions
Just me brainstorming some ideas.
Somewhat like Genshi’s py:def.
Idea, chunks of html can be placed into memory via r:def and then repeated with a simple element reference r:ref .
<div id="chunky_div" r:ref="foo"> ... loads of html </div>
can be replicated with simply
bq. <div r:ref="foo" />
A html block which is def’ed won’t render on the page.
Variables can be passed in:
<div id="hello world" r:def="hello_world">$msg for $current_user.name</dif>
which is referenced as
<div r:ref="hello_world, |'hello world', current_user" />
Not sure about variable referencing, passing in a hash is probably a better idea, but it should probably try and resolve variables locally too (e.g. if current_user isn’t passed in, the reference block should try resolving it on the local binding before giving up).
Not sure if it’s worth doing this. Rails partials can handle this. Just jotting down the idea.