the goal would just be to have a unique class and id for one attribute
of a particular object, for ajax updates. so, i might use the
following haml:

[EMAIL PROTECTED]
  = @item.name
  was updated at
  [EMAIL PROTECTED] @item.updated_at

to generate this html:

<div class="item" id="item_5">
  my fifth item
  was updated at
  <span class="item_updated_at" id="item_updated_at_5">2006-07-29</
span>
</div>

some javascript elsewhere would look like this:

<script>
  function set_item_updated(id, val) {
    $('item_updated_at_'+id).inner_html = val;
  }
  set_item_updated(5, 'asdf');
</script>

On Feb 12, 8:52 pm, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
> I'm not sure what you mean... what exactly is updated_at returning? How
> would this mesh with the current behavior of [] (taking the id and class
> name of the variable placed in it)?
>
> - Nathan
>
>
>
> Drew Sears wrote:
> > first off, thanks for the fantastic templating engine. my markup is
> > finally beautiful! i've rewritten rhtml templates to half their size,
> > and now they look as elegant as the rest of rails.
>
> > one request: i'd like to be able to do [EMAIL PROTECTED]/ to get
> > <span class="item_updated_at" id="item_updated_at_5" /> or something
> > close.- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to