MCQs > IT & Programming > Ruby On Rails > Which choices will write routes for the API versioning scenario described below? /api/users returns a 301 to /api/v2/users /api/v1/users returns a 200 of users index at version 1 /api/v3/users returns a 301 to /api/v2/users /api/asdf/users returns a 301 to /api/v2/users

Ruby On Rails MCQs

Which of the following choices will write routes for the API versioning scenario described below?

/api/users returns a 301 to /api/v2/users
/api/v1/users returns a 200 of users index at version 1
/api/v3/users returns a 301 to /api/v2/users
/api/asdf/users returns a 301 to /api/v2/users

Answer

Correct Answer: namespace :api do namespace :v1 do resources :users end namespace :v2 do resources :users end match 'v:api/*path', :to => redirect("/api/v2/%{path}") match '*path', :to => redirect("/api/v2/%{path}") end

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Ruby On Rails Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Ruby On Rails Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it