Not quite sure how to do this?

It's JavaScript (probably) and there are various ways to do it - I'd
recomend checking out the Prototype library which makes this kind of
thing easer. Using Prototype you might do something like

<div id='thisPanel'>this is some text</div>
<a href="#" onClick="$('thisPanel').show(); return false;">show</a>
<a href="#" onClick="$('thisPanel').hide(); return false;">hide</a>

Clicking the links will hide and show the 'thisPanel' div. Expanding
and contracting is similarly achieved but really depends on the type
of effect you want.

Dale

here's another way that's a bit more railsish:

<div id="description">
  <%= description.truncate(100) %>
  <%= link_to_function "(more)", f = update_page { |p|
p.toggle("description"); p.toggle("description_more") } %>
</div>
<div id="description_more" style="display:none">
  <%= description %>
  <%= link_to_function "(less)", f %>
</div>

This really isn't AJAX. It would be, if the "more" description was
being pulled from the server on click.