簡體   English   中英

錯誤的參數數量(給定0,預期為1+)Rails

[英]Wrong number of arguments (given 0, expected 1+) Rails

我在幾乎不定制的devise新密碼頁面上收到此錯誤:

wrong number of arguments (given 0, expected 1+)

我的ERB很簡單:

<h1 style="color: black">Forgot Your Password?</h1>

<%= simple_form_for(resource, as: resource_name, url: password_path, html: { method: :post }) do |f| %>  <<<<<<<ERROR CALLED ON THIS LINE
    <%= f.error_notification %>

    <div class="form-inputs text-left">
        <%= f.input :email, required: true, autofocus: true %>
    </div>

    <div class="form-actions">
        <%= f.button :submit, "Send Me Reset Password Instructions", class: "btn-custom" %>
    </div>
<% end %>

<%= render "devise/shared/links" %>

但是我似乎無法弄清楚為什么會產生此錯誤。 有人遇到過這個問題嗎?

您需要將password_path更改為password_path(resource_name)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM