Topic: ruby

Posts related to the Ruby language.

Writing in Rack with a complete error catch

Man, forgetting to add my little error catching trick inside of one app I was writing made me realize how much I take such a simple trick for granted.

I basically write all my rack code in a way similar to that. Normally I'll probably throw in another error catching level that catches special formated ErrorPage classes for things like NoPage to generate a 404. But this here is…

  • programming
  • code
  • ruby

.erb, the buffer?

This one is a little bit old, but if any of you are familiar with rails' views you'll probably have seen bits of view code like:

And if you've ever jumped into erb in your own ruby you've probably made an attempt at doing something similar trying to put something into the buffer without the use of =. This is of course because ERB doesn't let you use blocks…