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

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -