Tech - August 2006 Archives

The Beauty of reverse_merge

There are frequent times in development when you want to use "keyword arguments" or in Rails-ish, an options hash. I had looked at some of the Hash extensions that are in the Rails framework in the past, but I had rarely used anything more than stringify_keys and symbolize_keys. Now, reverse_merge is my friend.

The Comments Strike Back

It seems I'm well on my way to implementing my behaviors. A couple of revisions and some previews of what I'm thinking for tags:

  1. It seems we won't need a behavior for the comments themselves. I have the CommentBucket behavior escaping any HTML that occurs in the post. Obviously, an author of the site can bypass this, but then the security is less of an issue.
  2. I haven't figured out how to redirect the response to the parent page for the CommentBucket behavior. Any ideas?

Tags:

  <r:comments:each>
    <r:title />

    <r:body />
    <r:author />
    <r:date />
  </r:comments:each>

  <r:comments:form />

As always, your thoughts are welcome and encouraged.