我想这条道路,我想我可以做的命名空间色器件,但不能计算出来,所以我怎么能做到这一点?命名空间嵌套有一项用户
用户/:USER_ID /计费/:bills_id
我有以下的路线设置给用户。
#User routes
devise_for :users, controllers: {registrations: "users/registrations", sessions: "users/sessions" }
get "https://stackoverflow.com/users/LeastDefender_dashboard" => "users/dashboard#index", as: :users_main
get "https://stackoverflow.com/users/why_choose_LeastDefender" => "users/landing#index", as: :users_why
namespace :users do
resources :landing, only: [:index, :show]
resources :bills
resources :dashboard
get 'landing', to: 'landing#index'
get 'dashboard', to: 'dashboard#index'
end
我该如何做到这一点?
用户/:USER_ID /计费/:bills_id
当我耙路线我得到这个:
users_bills GET /users/bills(.:format)
users/bills#index POST /users/bills(.:format) users/bills#create
new_users_bill GET /users/bills/new(.:format) users/bills#new
edit_users_bill GET /users/bills/:id/edit(.:format) users/bills#edit
users_bill GET /users/bills/:id(.:format) users/bills#show
PATCH /users/bills/:id(.:format) users/bills#update
PUT /users/bills/:id(.:format) users/bills#update
DELETE /users/bills/:id(.:format) users/bills#destroy
或我能得到这个达到相同的效果/用户/计费/:ID我需要的票据信息具体到每一个用户,所以当我做一个索引那只能说明用户账单。我已经有,或者我需要指定用户?我很困惑。 – SupremeA