레일 3에서 작동하지 않는 커스텀 플러그인이 있습니다 (필자는 쓰지 않았습니다). 그러나 레일 2에서 작동했습니다. 다음은 기본 모듈의 모습입니다.레일 3 - 플러그인이 '정의되지 않은 로컬 변수'를 반환합니다.
#lib/auth.rb
module ActionController
module Verification
module ClassMethods
def verify_identity(options = {})
class_eval(%(before_filter :validate_identity, :only => options[:only], :except => options[:except]))
end
end
end
class Base
#some configuration variables in here
def validate_identity
#does stuff to validate the identity
end
end
end
#init.rb
require 'auth'
require 'auth_helper'
ActionView::Base.send(:include, AuthHelper)
AuthHelper는 그룹 구성원 기반의 인증을위한 간단한 도우미 방법을 포함합니다.
내가 actioncontroller에 'verify_identity'를 포함
: TestController에 대한 정의되지 않은 지역 변수 또는 메소드`verify_identity ':class TestController < ApplicationController
verify_identity
....
end
나는 라우팅 오류 클래스. 어떻게하면이 문제를 해결할 수 있을까요? 감사!