Well that was easy…
added 2 checks from the application controller.
skip_before_filter :check_xhr #allow API requests
before_filter :ensure_logged_in #or just check the users logged in
skip_before_filter :check_xhr ← does as it says.
looks for a XHR request and requires an API key skips and other checks if found.
before_filter :ensure_logged_in ← another brilliant function name.
Looks for user login
Close it up @codinghorror !