Archive for the ‘ActionController’ Category

CacheSweepers and url_for

Monday, December 31st, 2007 Posted in ActionController, ActionView, Rails, Ruby | No Comments »

It appears url_for only seems to work correctly in a CacheSweeper when running a server in production mode. I've confirmed this in Rails 2.0.2. class MySeeper < ActionController::Caching::Sweeper observe Item def after_create(item) value = url_for(:controller => :items) end end In development mode, value evaluates ...

Rails Controller inheritance and Modules

Tuesday, August 28th, 2007 Posted in ActionController, Object-Oriented Programming | No Comments »

The topic of Controller inheritance may be straightforward for more advanced developers, but it isn't completely straightforward for people new to Rails or the Ruby language in general. Rails Controllers generally come in the following flavor: class SomeController < ApplicationController ...