don’t think it’s gonna work that way. You can do that using before_filter
class ThingController < ApplicationController before_filter :setup
def index @listings = @model_name.paginated_list (params[:page]) end
def detail @listing = @model_name.find(params[:id]) end
private def setup @model_name = params[:section].classify.constantiz @section_name = params[:section]
end
end
there’s more at http://railsmanual.org/module/ActionController::Filters::ClassMethods