Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails designe:Unpermitted参数::designe::SessionController的名称_Ruby On Rails_Devise - Fatal编程技术网

Ruby on rails designe:Unpermitted参数::designe::SessionController的名称

Ruby on rails designe:Unpermitted参数::designe::SessionController的名称,ruby-on-rails,devise,Ruby On Rails,Devise,我正在使用designe并尝试使用:name和:password字段登录。我无法登录,rails控制台中出现以下错误: Started POST "/users/sign_in" for ::1 at 2020-11-04 20:53:24 +0600 Processing by Users::SessionsController#create as HTML Parameters: {"authenticity_token"=>"44

我正在使用designe并尝试使用
:name
:password
字段登录。我无法登录,rails控制台中出现以下错误:

Started POST "/users/sign_in" for ::1 at 2020-11-04 20:53:24 +0600
Processing by Users::SessionsController#create as HTML
  Parameters: {"authenticity_token"=>"4481vpATudbSpQEOFHZJ0fLLf2ppgSnM4YrmsddOYGtQInJsgK+PBnjkp5avKL5p+iR/E7qqXGEBfPLPcm4Rww==", "user"=>{"name"=>"Abdullah Numan", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"}
Completed 401 Unauthorized in 2ms (ActiveRecord: 0.0ms | Allocations: 598)


Processing by Users::SessionsController#new as HTML
  Parameters: {"authenticity_token"=>"4481vpATudbSpQEOFHZJ0fLLf2ppgSnM4YrmsddOYGtQInJsgK+PBnjkp5avKL5p+iR/E7qqXGEBfPLPcm4Rww==", "user"=>{"name"=>"Abdullah Numan", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"}
Unpermitted parameter: :name
我使用的是
simple\u form
,它看起来是这样的:

#sessions/new.html.erb

<div class="column is-4">
        <h2 class="title is-3">Log In</h2>
        <%= simple_form_for(resource, as: resource_name, url: new_user_session_path) do |f| %>
          <%= f.error_notification %>
          <div class="field">
            <div class="control">
              <%= f.input :name,
                          required: true,
                          autofocus: true,
                          input_html: { autocomplete: "name", class: "input" },
                          wrapper: false,
                          label_html: { class: "label"} %>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <%= f.input :password,
                          required: true,
                          input_html: { autocomplete: "current-password", class: "input" },
                          wrapper: false,
                          label_html: { class: "label"} %>
            </div>
          </div>

          <div class="field">
            <div class="control">
              <%= remember_me_checkbox(f) %>
            </div>
          </div>

          <div class="field">
            <div class="control">
              <%= f.button :submit, "Log in", class: "button is-primary" %>
            </div>
          </div>
        <% end %>
        <br>
        <%= render "devise/shared/links" %>
        </div>
      </div>

我试着在中使用这些指南,但它们不起作用。我该如何解决这个问题?

这有帮助吗?@RockwellRice lol我来这里发布这个确切的链接。向上一个!
class Users::SessionsController < Devise::SessionsController

  protected

  def after_sign_in_path_for(resource)
    user_path(resource)
  end
end