ankane / pretender

Log in as another user in Rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rails API support

brunowego opened this issue · comments

When try access my API, I get the follow error:

ActionController::RoutingError (undefined method `impersonates' for ApplicationController:Class):

My controller extends to ActionController::API:

class ApplicationController < ActionController::API
  include AuthenticationConcern
  include AuthorizationConcern

  impersonates :user
end

Looking at the gem code, I see that extend from ActionController :: Base.

Yep! If I change to class ApplicationController < ActionController::Base works.

But I think this is not the right way. 😕