{"action":"created","issue":{"url":"https://api.github.com/repos/b2beauty/jsonapi-utils/issues/4","repository_url":"https://api.github.com/repos/b2beauty/jsonapi-utils","labels_url":"https://api.github.com/repos/b2beauty/jsonapi-utils/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/b2beauty/jsonapi-utils/issues/4/comments","events_url":"https://api.github.com/repos/b2beauty/jsonapi-utils/issues/4/events","html_url":"https://github.com/b2beauty/jsonapi-utils/issues/4","id":144259566,"number":4,"title":"NoMethodError when triggering a jsonapi_render_not_found error","user":{"login":"gee-forr","id":345730,"avatar_url":"https://avatars.githubusercontent.com/u/345730?v=3","gravatar_id":"","url":"https://api.github.com/users/gee-forr","html_url":"https://github.com/gee-forr","followers_url":"https://api.github.com/users/gee-forr/followers","following_url":"https://api.github.com/users/gee-forr/following{/other_user}","gists_url":"https://api.github.com/users/gee-forr/gists{/gist_id}","starred_url":"https://api.github.com/users/gee-forr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gee-forr/subscriptions","organizations_url":"https://api.github.com/users/gee-forr/orgs","repos_url":"https://api.github.com/users/gee-forr/repos","events_url":"https://api.github.com/users/gee-forr/events{/privacy}","received_events_url":"https://api.github.com/users/gee-forr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-29T13:09:52Z","updated_at":"2016-03-30T17:43:37Z","closed_at":"2016-03-30T17:43:37Z","body":"Hi there,\r\n\r\nFirstly, thank you for this gem, it makes using JR much easier when dealing with API's more complex than the simple examples in the docs. I really appreciate it.\r\n\r\nI'm getting this weird error when triggering a `jsonapi_render_not_found` error. It seems the params hash gets lost somewhere. Anyway, here's the code (it's for a multi-tenant system, which is why I'm searching from the current_user.\r\n\r\n```ruby\r\nmodule API\r\n  module V1\r\n    class AccountsController < AuthenticatedController\r\n      include JSONAPI::ActsAsResourceController\r\n\r\n      def show\r\n        jsonapi_render json: current_user.accounts.find(params[:id])\r\n      end\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nAnd here's the exception and stacktrace... I hope you can help...\r\n\r\nNoMethodError in API::V1::AccountsController#show: undefined method `params' for nil:NilClass\r\n\r\n```\r\njsonapi-utils (0.4.0) lib/jsonapi/utils.rb:46:in `jsonapi_render_not_found'\r\nactivesupport (4.2.6) lib/active_support/rescuable.rb:80:in `call'\r\nactivesupport (4.2.6) lib/active_support/rescuable.rb:80:in `rescue_with_handler'\r\nactionpack (4.2.6) lib/action_controller/metal/rescue.rb:15:in `rescue_with_handler'\r\nactionpack (4.2.6) lib/action_controller/metal/rescue.rb:32:in `rescue in process_action'\r\nactionpack (4.2.6) lib/action_controller/metal/rescue.rb:29:in `process_action'\r\nactionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'\r\nactivesupport (4.2.6) lib/active_support/notifications.rb:164:in `block in instrument'\r\nactivesupport (4.2.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'\r\nactivesupport (4.2.6) lib/active_support/notifications.rb:164:in `instrument'\r\nactionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'\r\nactionpack (4.2.6) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'\r\nactiverecord (4.2.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'\r\nactionpack (4.2.6) lib/abstract_controller/base.rb:137:in `process'\r\nactionview (4.2.6) lib/action_view/rendering.rb:30:in `process'\r\nactionpack (4.2.6) lib/action_controller/metal.rb:196:in `dispatch'\r\nactionpack (4.2.6) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'\r\nactionpack (4.2.6) lib/action_controller/metal.rb:237:in `block in action'\r\nactionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'\r\nactionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:43:in `serve'\r\nactionpack (4.2.6) lib/action_dispatch/journey/router.rb:43:in `block in serve'\r\nactionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `each'\r\nactionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve'\r\nactionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call'\r\nrack-pjax (0.8.0) lib/rack/pjax.rb:12:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'\r\nwarden (1.2.4) lib/warden/manager.rb:35:in `block in call'\r\nwarden (1.2.4) lib/warden/manager.rb:34:in `catch'\r\nwarden (1.2.4) lib/warden/manager.rb:34:in `call'\r\nrack (1.6.4) lib/rack/etag.rb:24:in `call'\r\nrack (1.6.4) lib/rack/conditionalget.rb:25:in `call'\r\nrack (1.6.4) lib/rack/head.rb:13:in `call'\r\nremotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'\r\nrack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'\r\nrack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'\r\nactiverecord (4.2.6) lib/active_record/query_cache.rb:36:in `call'\r\nactiverecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'\r\nactiverecord (4.2.6) lib/active_record/migration.rb:377:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'\r\nactivesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__'\r\nactivesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'\r\nactivesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'\r\nweb-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call'\r\nweb-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'\r\nweb-console (2.3.0) lib/web_console/middleware.rb:18:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'\r\nrailties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'\r\nrailties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'\r\nactivesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'\r\nactivesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'\r\nactivesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'\r\nrailties (4.2.6) lib/rails/rack/logger.rb:20:in `call'\r\nrequest_store (1.2.1) lib/request_store/middleware.rb:8:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'\r\nrack (1.6.4) lib/rack/methodoverride.rb:22:in `call'\r\nrack (1.6.4) lib/rack/runtime.rb:18:in `call'\r\nactivesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'\r\nrack (1.6.4) lib/rack/lock.rb:17:in `call'\r\nactionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'\r\nrack (1.6.4) lib/rack/sendfile.rb:113:in `call'\r\nrack-cors (0.4.0) lib/rack/cors.rb:80:in `call'\r\nrailties (4.2.6) lib/rails/engine.rb:518:in `call'\r\nrailties (4.2.6) lib/rails/application.rb:165:in `call'\r\npuma (2.15.3) lib/puma/commonlogger.rb:31:in `call'\r\npuma (2.15.3) lib/puma/configuration.rb:79:in `call'\r\npuma (2.15.3) lib/puma/server.rb:541:in `handle_request'\r\npuma (2.15.3) lib/puma/server.rb:388:in `process_client'\r\npuma (2.15.3) lib/puma/server.rb:270:in `block in run'\r\npuma (2.15.3) lib/puma/thread_pool.rb:106:in `block in spawn_thread'\r\n```"},"comment":{"url":"https://api.github.com/repos/b2beauty/jsonapi-utils/issues/comments/203547263","html_url":"https://github.com/b2beauty/jsonapi-utils/issues/4#issuecomment-203547263","issue_url":"https://api.github.com/repos/b2beauty/jsonapi-utils/issues/4","id":203547263,"user":{"login":"tiagopog","id":760933,"avatar_url":"https://avatars.githubusercontent.com/u/760933?v=3","gravatar_id":"","url":"https://api.github.com/users/tiagopog","html_url":"https://github.com/tiagopog","followers_url":"https://api.github.com/users/tiagopog/followers","following_url":"https://api.github.com/users/tiagopog/following{/other_user}","gists_url":"https://api.github.com/users/tiagopog/gists{/gist_id}","starred_url":"https://api.github.com/users/tiagopog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiagopog/subscriptions","organizations_url":"https://api.github.com/users/tiagopog/orgs","repos_url":"https://api.github.com/users/tiagopog/repos","events_url":"https://api.github.com/users/tiagopog/events{/privacy}","received_events_url":"https://api.github.com/users/tiagopog/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T17:43:37Z","updated_at":"2016-03-30T17:43:37Z","body":"Fixed :-)"}}