April 2008 Archives

Building a plugin (form_for and overriding methods continued)

In my last post, we looked at why Rails doesn't use getter methods in form_for. We also came up with a relatively ugly fix. In this post, we'll clean that code up and turn it into a plugin.

Continue Reading…

Posted by Mike Mangino on Apr 28, 2008

form_for and overriding methods

From time to time, we override ActiveRecord attribute methods to add some additional behavior. Yesterday, I was working on some code to require a user to approve a new email address before the change was made and ran into some problems using my new methods in forms. I'll show you how to fix this inside

Continue Reading…

Posted by Mike Mangino on Apr 24, 2008

Enabling MemCached sessions

Rails has been able to store session data in MemCached since version 2.0 was released. I've been able to make it work locally, but never in production. Until now that is. I'll show you the really simple trick to make it work.

Continue Reading…

Posted by Mike Mangino on Apr 23, 2008

Block handling view helpers

Over the past few years, my code has become much more DRY. Until recently though, I've found my HTML difficult to refactor. Inside, we'll take a look at how to use view helpers to DRY up complex HTML.

Continue Reading…

Posted by Mike Mangino on Apr 21, 2008