我可以使用什么路径来显示current_user
自己列出的产品?
= button_to "View My Products", root_path, method: :get, class: "button"
而不是root_path
我尝试使用@product.user.all
which 不起作用。
谢谢!
编辑:
user GET /users/:id(.:format) users#show
search_products GET /products/search(.:format) products#search
products GET /products(.:format) products#index
POST /products(.:format) products#create
new_product GET /products/new(.:format) products#new
edit_product GET /products/:id/edit(.:format) products#edit
product GET /products/:id(.:format) products#show
PATCH /products/:id(.:format) products#update
PUT /products/:id(.:format) products#update
DELETE /products/:id(.:format) products#destroy
welcome_index GET /welcome/index(.:format) welcome#index
root GET / welcome#index
以及 Devise 的所有标准路线。