Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

responders - rails 4.2 #98

Closed
matteolc opened this issue Jan 2, 2015 · 8 comments
Closed

responders - rails 4.2 #98

matteolc opened this issue Jan 2, 2015 · 8 comments

Comments

@matteolc
Copy link

matteolc commented Jan 2, 2015

hi
is token auth ready for rails 4.2 (with responders gem moved out?)
i can't seem to get it to respond to :json ..
thanks

@lynndylanhurley
Copy link
Owner

@matteolc - I haven't tested against rails 4.2 yet. I'll take a look ASAP.

@matteolc
Copy link
Author

matteolc commented Jan 3, 2015

FYI

Here's my application controller:

class ApplicationController < ActionController::API

include ActionController::Caching
include ActionController::MimeResponds

def self.respond_to(*mimes)
include ActionController::RespondWith::ClassMethods
end

respond_to :json

include DeviseTokenAuth::Concerns::SetUserByToken
before_filter :authenticate_account!

end

I had to add

def self.respond_to(*mimes)
include ActionController::RespondWith::ClassMethods
end

to avoid the error: ActionController::RoutingError (The controller-level respond_to' feature has been extracted to theresponders` gem.

I think it's related to warden.

Thanks

@matteolc
Copy link
Author

matteolc commented Jan 3, 2015

So actually all that should be required to make it work when inheriting from ActionController::API is

class ApplicationController < ActionController::API

include ActionController::MimeResponds

def self.respond_to(*mimes)
include ActionController::RespondWith::ClassMethods
end

respond_to :json

end

(Not sure what wasn't working before :O)

@matteolc
Copy link
Author

matteolc commented Jan 3, 2015

weird..i got it to work, restarted the server, and got again halted before finding the user..

Filter chain halted as :authenticate_account! rendered or redirected

I guess validate_token should be called but it's not the first time? (I use ng-token auth)

:O

@lynndylanhurley
Copy link
Owner

@matteolc - I just updated to rails 4.2.

Can you please check out version 0.1.31.beta3 and let me know if it works for you?

@lynndylanhurley
Copy link
Owner

@matteolc - I just pushed version 0.1.31.beta6 and everything seems to be ok. Please re-open if you run into any issues.

@matteolc
Copy link
Author

matteolc commented Jan 7, 2015

Ok thanks!

@lynndylanhurley
Copy link
Owner

@matteolc - make that 0.1.31.beta8 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants