title: Full Rails 5 routes with Ancestry Gem nested tree
body: <p>I am using the <a href="https://github.com/stefankroes/ancestry" rel="nofollow noreferrer">Ancestry Gem</a> in my Rails 5 app and all things look and act as they should and my database looks good.  I just can't figure out  out how to show the full url path after the first level following the model name.</p>
  
  <p><strong>For Example</strong></p>
  
  <p>I need <code>http://127.0.0.1:3000/pages/29</code> to look like <code>http://127.0.0.1:3000/pages/22/29</code> (I'll implement friendly ids after its working).  In the above example, <code>id:29</code> is a subpage of ancestry <code>id:22</code></p>
  
  <p><strong>Screenshot of Database</strong></p>
  
  <p><a href="https://i.stack.imgur.com/vtvQf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vtvQf.png" alt="enter image description here"></a></p>
  
  <p><strong>page.rb</strong></p>
  
  <pre><code>class Page &lt; ApplicationRecord
    has_ancestry
  end
  </code></pre>
  
  <p><strong>pages_controller.rb</strong></p>
  
  <pre><code>...
  private
  ...
  def page_params
   params.require(:page).permit(:name, :content, :ancestry, :slug, :parent_id)
  end
  ...
  </code></pre>
  
  <p><strong>schema.rb</strong></p>
  
  <pre><code>create_table "pages", force: :cascade do |t|
    t.string "name"
    t.text "content"
    t.string "ancestry"
    t.string "slug"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["ancestry"], name: "index_pages_on_ancestry"
  end
  </code></pre>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>...
  resources :pages
  root to: 'pages#index'
  ...
  </code></pre>
  
  <p><strong>127.0.0.1:3000/rails/info/routes</strong></p>
  
  <pre><code>Helper  HTTP Verb   Path    Controller#Action
  Path / Url      
  Path Match
  stripe_event_path       /webhooks/stripe    
  StripeEvent::Engine
  
  new_user_session_path   GET /users/sign_in(.:format)    
  devise/sessions#new
  
  user_session_path   POST    /users/sign_in(.:format)    
  devise/sessions#create
  
  destroy_user_session_path   DELETE  /users/sign_out(.:format)   
  devise/sessions#destroy
  
  new_user_password_path  GET /users/password/new(.:format)   
  devise/passwords#new
  
  edit_user_password_path GET /users/password/edit(.:format)  
  devise/passwords#edit
  
  user_password_path  PATCH   /users/password(.:format)   
  devise/passwords#update
  
  PUT /users/password(.:format)   
  devise/passwords#update
  
  POST    /users/password(.:format)   
  devise/passwords#create
  
  cancel_user_registration_path   GET /users/cancel(.:format) 
  devise/registrations#cancel
  
  new_user_registration_path  GET /users/sign_up(.:format)    
  devise/registrations#new
  
  edit_user_registration_path GET /users/edit(.:format)   
  devise/registrations#edit
  
  user_registration_path  PATCH   /users(.:format)    
  devise/registrations#update
  
  PUT /users(.:format)    
  devise/registrations#update
  
  DELETE  /users(.:format)    
  devise/registrations#destroy
  
  POST    /users(.:format)    
  devise/registrations#create
  
  users_path  GET /users(.:format)    
  users#index
  
  POST    /users(.:format)    
  users#create
  
  new_user_path   GET /users/new(.:format)    
  users#new
  
  edit_user_path  GET /users/:id/edit(.:format)   
  users#edit
  
  user_path   GET /users/:id(.:format)    
  users#show
  
  PATCH   /users/:id(.:format)    
  users#update
  
  PUT /users/:id(.:format)    
  users#update
  
  DELETE  /users/:id(.:format)    
  users#destroy
  
  pages_path  GET /pages(.:format)    
  pages#index
  
  POST    /pages(.:format)    
  pages#create
  
  new_page_path   GET /pages/new(.:format)    
  pages#new
  
  edit_page_path  GET /pages/:id/edit(.:format)   
  pages#edit
  
  page_path   GET /pages/:id(.:format)    
  pages#show
  
  PATCH   /pages/:id(.:format)    
  pages#update
  
  PUT /pages/:id(.:format)    
  pages#update
  
  DELETE  /pages/:id(.:format)    
  pages#destroy
  
  root_path   GET /   
  pages#index
  
  Routes for StripeEvent::Engine
  root_path   POST    /   
  stripe_event/webhook#event
  </code></pre>