2011-07-21 71 views
0

我的路線包含以下內容:路線問題,在軌道路徑幫手3

namespace :admin do 
    resources :retailers 
    resources :drop_ship_orders do 
     collection do 
     post :edit_individual 
     put :update_individual 
     end 
     member do 
     put :fire 
     get :fire 
     post :resend 
     end 
    end 
end 

我的觀點包括:

<%= form_tag edit_individual_drop_ship_orders_path do %> 
<table class="index" id='listing_orders'> 
    <thead> 
    <tr data-hook="admin_orders_index_headers"> 
     <th><%= check_box_tag('test') %></th> 
     <% if @show_only_completed %> 
     <th><%= sort_link @search, :completed_at, t("activerecord.attributes.order.completed_at") %></th> 
     <% else %> 
     <th><%= sort_link @search, :created_at, t("order_date") %></th> 
     <% end %> 
     <th><%= sort_link @search, :number,   t("order_number") %></th> 
     <th><%= sort_link @search, :state,   t("status") %></th> 
     <th><%= sort_link @search, :shipment_state, t("shipment_state") %></th> 
     <th><%= sort_link @search, :email,   t("customer") %></th> 
     <th><%= sort_link @search, :total,   t("total") %></th> 
     <th data-hook="admin_orders_index_header_actions"></th> 
    </tr> 
    </thead> 
    <tbody> 
    <% @orders.each do |order| %> 
    <tr data-hook="admin_orders_index_rows"> 
     <td><%= check_box_tag "drop_ship_order_ids[]", order.id %></td> 
     <td><%= l (@show_only_completed ? order.order.completed_at : order.order.created_at).to_date %></td> 
     <td><strong><%= order.order.number %></strong></td> 
     <td><%= t("order_state.#{order.state.downcase}") %></td> 
     <td><%#= link_to t("shipment_states.#{order.order.shipment_state}"), admin_order_shipments_path(order) if order.shipment_state %></td> 
     <td><%= order.order.email %><br><%= order.order.ship_address.firstname%> <%= order.order.ship_address.lastname %><br><%= order.order.ship_address.phone %></td> 
     <td><%= number_to_currency order.total %></td> 
     <td class='actions' data-hook="admin_orders_index_row_actions"> 
     <%= button_link_to t(:process_order), edit_admin_drop_ship_order_url(order) unless order.completed?%> 
     </td> 
    </tr> 
    <% end %> 
    </tbody> 
</table> 
<%= will_paginate(@orders, :previous_label => "&#171; #{t('previous')}", :next_label => "#{t('next')} &#187;") %> 
<%= submit_tag (t('multi_process')) %> 
<% end %> 

Rails不承認edit_individual_drop_ship_orders_path

在我的控制我添加了edit_individual動作。

我的錯誤:#<#未定義的局部變量或方法`edit_individual_drop_ship_orders_path」:0x000001067314a8>

是否有人可以幫助我嗎?

謝謝

+4

當你遇到路由問題時要做兩件事:1.重啓服務器2.檢查'rake routes' – bassneck

+0

解決!謝謝! – mabounassif

回答

1

兩兩件事要做,當你有問題的路線:1.重新啓動服務器2.檢查rake routes

0

嘗試了這一點

 form_tag :url => admin_edit_individual_drop_ship_orders_path do 

檢查您已經添加的 '管理' 命名空間之前

0

的路線,這樣的路徑將是:

admin_edit_individual_drop_ship_orders_path 

您應該考慮切換到使用form_for來編輯資源。

0
rake routes 

上面的命令具有的所有路由相關問題的解決方案來分析在水平問題1.