Ruby Build a Rails API Coding the API Namespacing Review

Using the namespace method

Using the namespace method, change the routes file below to add a v1 namespace. The v1 namespace should be within the api namespace, and should include the todo_lists and todo_items resources.

routes.rb
Rails.application.routes.draw do
  namespace :api do

      resources :todo_lists do
        resources :todo_items do
          member do
            patch :complete
          end
        end
      end

  end
end

1 Answer

Seth Reece
Seth Reece
32,864 Points

Hi Andrew,

There are two blank lines to help you out here. On the first on you want namspace :v1 do and the second one end