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.
In 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.
def base_url
@base_url ||= request.protocol + request.host_with_port + self.config.relative_url_root
end
lib/jsonapi/acts_as_resource_controller.rb could use something like that as new default.
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.In my own app, I set for instance
config.relative_url_root = '/api', and this change broke my app. I had to override the ResourceController'sbase_urlmethod to fix this.lib/jsonapi/acts_as_resource_controller.rbcould use something like that as new default.