From: Josh Cheek Date: 2010-09-05T01:28:47+09:00 Subject: Re: Read cookie --001485f274e24e9a3b048f718a78 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2010/9/4 P=E5l Bergstr=F6m > Thank you for the clarification. I'll guess I will use the instance > variable and add it everywhere I need it. I was hoping I could avoid > that. > > You could put it in a method in your ApplicationController, then in each of your specific controllers, just use a before filter to apply it to the methods you want. Then you only have to have one additional line in each of the controllers that will use that before filter. class ApplicationController < ActionController::Base def verify_key redirect_to some_path unless logged_in? && current_user.valid_key?(session['aes-key']) end end class ResourcesTypeOneController < ApplicationController before_filter :verify_key , :only =3D> [:destroy, :edit , :update] # ... end class ResourcesTypeTwoController < ApplicationController before_filter :verify_key , :except =3D> [:show] # ... end --001485f274e24e9a3b048f718a78--