caseyli/capo — comment on commit f9452134d84feb7eb8dd28bbb272be2758ea3f48
File: app/controllers/users_controller.rb line 75
By jduff:

Your current update action should be able to handle the ajax version as well. I think the issue is using the `respond_to` block in the `before_filter`. If your filter is redirecting there isn't really any need to have the `respond_to` block.

In your view where you are doing the ajax request you can either:
1. Not handle the redirect you get back if the user isn't the correct one. This should be an edge case anyways where someone is hacking the form or something similar, they don't need nice error messages :).
2. When you get the redirect you can show the not authorized message.