2012-10-08 121 views
3

我是Rails的新手。我已經安裝了最新設計的寶石,我得到這個錯誤:Devise/registrations中的參數錯誤#錯誤的參數個數

ArgumentError in Devise/registrations#new 

Showing /Users/Malone/Sites/todos/app/views/devise/registrations/new.html.erb where line #3 raised: 
Wrong number of arguments (3 for 2) 
Extracted source (around line #3): 
1: <h2>Sign up</h2> 
2: 
3: <%= form_for(resource_name, resource,: URL => registration_path(resource_name)) do |f| %> 
4: <%= f.error_messages %> 
5: <p><%= f.label: email %></p> 
6: <p><%= f.text_field: email %></p> 

不知道你需要什麼其他信息來幫助我。但讓我知道。

回答

0

變化

<%= form_for(resource_name, resource, :url => registration_path(resource_name)) do |f| %> 

​​
+0

這個工作!謝謝! –

0

解決您的問題試試這個

<h2>Sign up</h2> 
    <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> 
    <%= f.error_messages %> 
    <p><%= f.label: email %></p> 
    <p><%= f.text_field: email %></p> 
    .... 
    .... 
    <% end %>