{"action":"created","issue":{"url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/473","repository_url":"https://api.github.com/repos/cerebris/jsonapi-resources","labels_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/473/labels{/name}","comments_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/473/comments","events_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/473/events","html_url":"https://github.com/cerebris/jsonapi-resources/issues/473","id":109651591,"number":473,"title":"Make acts_as_resource_controller's base_url method be compatible with custom Rails config.relative_url_root","user":{"login":"masda70","id":3266573,"avatar_url":"https://avatars.githubusercontent.com/u/3266573?v=3","gravatar_id":"","url":"https://api.github.com/users/masda70","html_url":"https://github.com/masda70","followers_url":"https://api.github.com/users/masda70/followers","following_url":"https://api.github.com/users/masda70/following{/other_user}","gists_url":"https://api.github.com/users/masda70/gists{/gist_id}","starred_url":"https://api.github.com/users/masda70/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masda70/subscriptions","organizations_url":"https://api.github.com/users/masda70/orgs","repos_url":"https://api.github.com/users/masda70/repos","events_url":"https://api.github.com/users/masda70/events{/privacy}","received_events_url":"https://api.github.com/users/masda70/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-03T23:27:32Z","updated_at":"2016-02-09T18:45:54Z","closed_at":null,"body":"Right now, if the Rails app uses a custom `relative_url_root`, the JSONAPI link builder will use the wrong base url to build its links.\r\n\r\nIn my own app, I set for instance `config.relative_url_root = '/api'`, and this change broke my app. I had to override the ResourceController's `base_url` method to fix this.\r\n\r\n```ruby\r\n  def base_url\r\n    @base_url ||= request.protocol + request.host_with_port + self.config.relative_url_root\r\n  end\r\n```\r\n\r\n`lib/jsonapi/acts_as_resource_controller.rb` could use something like that as new default."},"comment":{"url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/comments/181999427","html_url":"https://github.com/cerebris/jsonapi-resources/issues/473#issuecomment-181999427","issue_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/473","id":181999427,"user":{"login":"iirving","id":24158,"avatar_url":"https://avatars.githubusercontent.com/u/24158?v=3","gravatar_id":"","url":"https://api.github.com/users/iirving","html_url":"https://github.com/iirving","followers_url":"https://api.github.com/users/iirving/followers","following_url":"https://api.github.com/users/iirving/following{/other_user}","gists_url":"https://api.github.com/users/iirving/gists{/gist_id}","starred_url":"https://api.github.com/users/iirving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iirving/subscriptions","organizations_url":"https://api.github.com/users/iirving/orgs","repos_url":"https://api.github.com/users/iirving/repos","events_url":"https://api.github.com/users/iirving/events{/privacy}","received_events_url":"https://api.github.com/users/iirving/received_events","type":"User","site_admin":false},"created_at":"2016-02-09T18:45:54Z","updated_at":"2016-02-09T18:45:54Z","body":":+1: I'm seeing this as well in that a show method, customized as per the example,  in a JSONAPI::ResourceController creates a json with relative url's missing the protocol and the host_with_port; whereas the default jsons have full absolute urls."}}