0
我有以下鏈接軌道4路由與編輯字段
<%= link_to 'Update Profile', controller: :customers, action: :edit, id: session[:customer_id] %>
將生成的URL
http://localhost:3000/customers/17/edit
但是,當我修改我的路線爲
get 'edit_customer' => 'customers#edit'
我的鏈接像這樣
<li><%= link_to 'Update Profile', edit_customer_path(session[:customer]) %></li>
生成的URL是
http://localhost:3000/customers//edit
如何糾正這一
我希望會話[:客戶]持有的客戶ID – overflow
@Seting是你的權利 – kndwsu