Save 36% for Black Friday! Learn more

Pablo Seo

Joined

660 Experience
6 Lessons Completed
0 Questions Solved

Activity

Posted in problem with like link in nested resource

when i click i got this error message:

POST http://localhost:5000/users/modas-sol/catalogs/13/pages/10/types/24 404 (Not Found)

Posted in problem with like link in nested resource

Hi Chris im doing the episode 'liking posts' i have difficult to do with deep nested resource,
my actual nested resources looks:

A. Routes:

  resources :users do
      resources :catalogs do
          resources :pages do
              resources :types do
                  resources :like, module: :types
              end
          end
      end
  end

B. link:

= link_to 'Like', [current_user, @catalog, @page, @type, @like], method: :post

C. Rake Routes:

user_catalog_page_type_like_index GET    /users/:user_id/catalogs/:catalog_id/pages/:page_id/types/:type_id/like(.:format)       types/like#index                                                   ____________________________ POST   /users/:user_id/catalogs/:catalog_id/pages/:page_id/types/:type_id/like(.:format)      types/like#create  new_user_catalog_page_type_like  GET     /users/:user_id/catalogs/:catalog_id/pages/:page_id/types/:type_id/like/new(.:format)      types/like#new
 edit_user_catalog_page_type_like GET     /users/:user_id/catalogs/:catalog_id/pages/:page_id/types/:type_id/like/:id/edit(.:format) types/like#edit
      user_catalog_page_type_like GET         /users/:user_id/catalogs/:catalog_id/pages/:page_id/types/:type_id/like/:id(.:format)      types/like#show
                                  PATCH  /users/:user_id/catalogs/:catalog_id/pages/:page_id/types/:type_id/like/:id(.:format)      types/like#update
                                  PUT    /users/:user_id/catalogs/:catalog_id/pages/:page_id/types/:type_id/like/:id(.:format)      types/like#update
                                  DELETE /users/:user_id/catalogs/:catalog_id/pages/:page_id/types/:type_id/like/:id(.:format)      types/like#destroy

The link is not working, have any idea?

Thank you!

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.