add resource as special attribute in base controller