:except not working in before_filter in application controller. Routing problem? :except not working in before_filter in application controller. Routing problem? ruby-on-rails ruby-on-rails

:except not working in before_filter in application controller. Routing problem?


The :except option takes action names, not url parts. Here's what you should do instead:

class ApplicationController < ActionController::Base  before_filter :update_activity_time  ...end

Then, in sessions_controller.rb:

class SessionsController < ApplicationController  skip_before_filter :update_activity_time, :only => [:new, :destroy]  ...end

You don't want to put the :except in ApplicationController because, if you did, the new and destroy actions for every one of your app's controllers wouldn't update the activity time.