Changing Rails routes. Does it affect how APIs to that route work? -
i'm changing route in rails app's route file:
from:
get '/apples/:id', to: 'apples#show', as: 'apple'
to:
get '/apples/:public_id', to: 'apples#show', as: 'apple'
i realize if types in:
root/apples/17
inside controller, params read like:
{public_id: 17}
now.
that's fine. affect how client apis need pass in key-value pairs route? reason ask because needed update controller tests before each test:
subject { :show, public_id: apple_id }
instead of:
subject { :show, id: apple_id }
why did need this? imply params route need passed in same way?
Comments
Post a Comment