Ruby’s “each” for JavaScript

posted in: javascript, ruby, tutorial | 0

Wow! 30 new subscribers due to my last blog posting about JavaScript inheritance: Welcome dear new readers 🙂 Due to this fact I’ve decided to try out something new. No fancy new technologies for showing-off but a tutorial-like introduction to … Continued

May I Cite Myself?

posted in: rails, ruby | 0

Well I’ll just do it. Maybe it’s because I’m motivated by my new blog theme. Or maybe because my blog is now running on Drupal instead of WordPress – well what the heck? 😉 Anyway, I tought it’s time to … Continued

timed_fragment_cache on Rails 2.1

posted in: cache, fragment caching, rails, ruby | 0

With Rails 2.1 cache_erb_fragment has been replaced by write_fragment. This breaks a plugin I really enjoy to use: timed_fragment_cache by Richard Livsey.

It basically allows you to specify an expiry for the fragments you cache, e.g. inside memcache, by adding a “meta” fragment for the fragment you store containing the expiry time.

Some usage examples – pretty self-explaining:

In your view:

<%- cache 'my_key', 1.hour.from_now do -%>
	...
<%- end -%>

With extensive queries – your view …:

<%- cache 'some_posts' -%>

Memory Leaks in GetText for Ruby on Rails

posted in: gettext, rails, ruby | 0

Version 1.90.0 of GetText for Ruby has quite some memory leaks in its Rails support files. In my case, the memory Mongrel used increased by 1 MB with each request it served… Quite amazing that you don’t really find someone else having the problem… Well there’s at least a bug report on rubyforge…

Monkey-patching gettext.rb with the following code made things quite more relaxed:

  def bound_target(klass = self) # :nodoc:
ret = nil

Developers are Musicians

posted in: rails, ruby | 0

Some random (and slightly interpreted) quotes by Ryan McMinn of unspace.ca, a Canadian project company: Specs = Speculations Contracts induce Software that works but sucks Developing Software is getting a career option Developers are Musicians Check out the video – … Continued

RDT and RadRails Keyboard Shortcuts

posted in: rails, ruby | 0

RDT together with RadRails on Eclipse is a pretty convenient development environment when doing things in Ruby on Rails. A little unknown are the keyboard shortcuts, which make your day even more productive. Here’s a list of those:

Ctrl-Alt-T

Jump to the test case of a model or controller and vice versa.

Ctrl-Shift-V

Jump to the view of a controller method and vice versa.

Ctrl-Alt-X