Search code examples
ruby-on-railsdeclarative-authorization

current_user method is not accessible


i am using declarative_authorization... when i try to access current_user, it gives me the error undefined local variable or method `current_user'... can anyone help me out..?

thnx...


Solution

  • current_user is a method that has to be provided for declarative authorization, not something it provides.

    From the read me:

    Requirement:

    An authentication mechanism

    • User object in Controller#current_user
    • (For model security) Setting Authorization.current_user

    There is also a section in that read me also about providing the requirements using restful authentication to provide the current_user functionality.