Sorry if this might be a stupid question, but I can't get my filters to inherit the way the Rails 3 documentation says it should be.
In particular, I have an Admin controller that was generated with:
rails generate controller admin
I added only one action to the administrator controller, before the filter and the private filter method.
class AdminController < ApplicationController
before_filter require_admin_creds
def index
end
private
def require_admin_creds
unless current_user && current_user.admin?
flash[:error] = ...
redirect_to ....
end
end
end
Then I created my nested resources in the admin section using
rails generate scaffold admin/model
As long as my admin index really gets the filter, the admin / model index (or any other actions) are not. What happens under the hood here that I should have ruled out?
Thanks in advance.
source
share