我尝试创建一个部分与我的车型之一的更新形式,但是当我运行服务器,并与部分浏览的页面,我得到一个奇怪的例外:回报率:不能更新模型
NoMethodError in Simpadmin/transactions#index
Showing /home/ben/proj/Simplee/master/app/views/simpadmin/transactions/_transaction_actions.html.haml where line #17 raised:
undefined method `payments_transaction_path' for #<#<Class:0x00000007bf1768>:0x00000007bceb00>
Extracted source (around line #17):
14: %span.refund-success= flash[:refund_success]
15:
16: .refund-edit
17: = form_for transaction do |refund_form|
18: .refund-reason
19: = refund_form.label(:refund_reason, "Reason for refund:")
20: = select_tag(:refund_reason, options_for_select(possible_refund_emails), :class => 'refund-reason-select')
Trace of template inclusion: app/views/simpadmin/transactions/_
item.html.haml, app/views/simpadmin/transactions/index.html.haml
或许真的是错了我击溃(?) 我应该改变部分本身的东西?
编辑:路线不是由我写的。无论如何,这里是交易的路线部分:
resources :transactions, :only => [:index, :update, :show] do
155 collection do
156 get :export
157 post :edit_cashed_checks
158 put :update_cashed_checks
159 end
160 member do
161 match :update_payee, :via => [:post, :put]
162 match :add_comment, :via => :post
163 put :refund
164 end
165 end
让知道路线文件内容请... –
问题与路由,确保 –
作为Sush说,路线现在会有所帮助。而且,最好知道'transaction'对象是什么类。我怀疑'PaymentTransaction'。 –