From a57b7101e9d3914144d25483905c77bbafbfaed5 Mon Sep 17 00:00:00 2001 From: Beniamin Bartkowiak Date: Thu, 19 Jan 2017 12:44:03 +0000 Subject: [PATCH] path option is now used when generating url paths --- lib/jsonapi/routing_ext.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jsonapi/routing_ext.rb b/lib/jsonapi/routing_ext.rb index 77af89e7a..11df612f8 100644 --- a/lib/jsonapi/routing_ext.rb +++ b/lib/jsonapi/routing_ext.rb @@ -23,7 +23,7 @@ def jsonapi_resource(*resources, &_block) options = resources.extract_options!.dup options[:controller] ||= @resource_type options.merge!(res.routing_resource_options) - options[:path] = format_route(@resource_type) + options[:path] = format_route(options[:path] || @resource_type) if options[:except] options[:except] << :new unless options[:except].include?(:new) || options[:except].include?('new') @@ -86,7 +86,7 @@ def jsonapi_resources(*resources, &_block) options[:param] = :id - options[:path] = format_route(@resource_type) + options[:path] = format_route(options[:path] || @resource_type) if res.resource_key_type == :uuid options[:constraints] ||= {}