2010-10-08 62 views
0

我將Rails 2.3.5應用程序轉換爲Rails 3應用程序。我得到一個錯誤在下面的代碼Rails 3異常通知錯誤

錯誤

Undefined method `filter_sensitive_post_data_parameters' for #<#<Class:0x0000010726a478>:0x000001069e7080> 

在app /視圖/ exception_notifier/_request.rhtml

<% if @request.respond_to?(:protocol) %> 
     * URL  : <%= @request.protocol %><%= @host %><%= @request.request_uri %> 
     * IP address: <%= @request.env["HTTP_X_FORWARDED_FOR"] || @request.env["REMOTE_ADDR"] %> 
     * Parameters: <%= send(:filter_sensitive_post_data_parameters,@request.parameters).inspect %> 
     * Rails root: <%= @rails_root %> 
     <% else %> 
     * Exception did not occur in controller, and was recoverable. 
     <% end %> 

停留3小時。請幫助

回答

0

這也許是因爲這種方法不會再對Rails通過request.filtered_parameters()

<% if request.respond_to?(:protocol) %> 
     * URL  : <%= request.protocol %><%= @host %><%= request.request_uri %> 
     * IP address: <%= request.env["HTTP_X_FORWARDED_FOR"] || request.env["REMOTE_ADDR"] %> 
     * Parameters: <%= request.filtered_parameters().inspect %> 
     * Rails root: <%= @rails_root %> 
<% else %> 
     * Exception did not occur in controller, and was recoverable. 
<% end %> 
+0

得到這個錯誤 - 缺少rack.input – Anand 2010-10-08 15:15:28

+0

而且沒有@存在3.更改呢?我用那個更新我的答案。你如何定義這個@request?這個rack.input丟失在哪裏? – shingara 2010-10-08 15:52:45

+0

這個錯誤顯示在行request.filtered_pa​​rameters()。inspect – Anand 2010-10-10 15:28:23