Ruby on rails 设计注册而不是拉场

Ruby on rails 设计注册而不是拉场,ruby-on-rails,devise,Ruby On Rails,Devise,好的,我已经安装了Desive,我有我的注册页面,但当我在其中输入内容时,它告诉我它是空的,不能是空的。我已经确认了存在和所有这些,所以我无法理解发生了什么。请看下面的表格,但我也注意到它的闪烁电子邮件/密码不能为空两次 让我知道你还需要什么 设计/注册.html.erb 注册 我明白这一点,为什么名称、配置文件名称是不允许的,这与attr\u可访问性有关吗 解决方案。即使安装了受保护的_属性,您仍需要将以下内容放入 class ApplicationController < Action

好的,我已经安装了Desive,我有我的注册页面,但当我在其中输入内容时,它告诉我它是空的,不能是空的。我已经确认了存在和所有这些,所以我无法理解发生了什么。请看下面的表格,但我也注意到它的闪烁电子邮件/密码不能为空两次

让我知道你还需要什么

设计/注册.html.erb

注册 我明白这一点,为什么名称、配置文件名称是不允许的,这与attr\u可访问性有关吗

解决方案。即使安装了受保护的_属性,您仍需要将以下内容放入

class ApplicationController < ActionController::Base
before_filter :configure_permitted_parameters, if: :devise_controller?
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception



  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:name, :profile_name, :email, :password, :password_confirmation) }
  end
end
class ApplicationController
即使使用受保护的属性,您仍然需要将以下内容放入应用程序控制器中:

class ApplicationController < ActionController::Base
before_filter :configure_permitted_parameters, if: :devise_controller?
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception



  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:name, :profile_name, :email, :password, :password_confirmation) }
  end
end
class ApplicationController
您是否明确允许控制器中的参数

除了配置\u允许的\u参数外,还需要此功能

例如


请继续阅读有关如何调试rails应用程序的内容:谢谢,我会阅读这篇文章。这很有帮助,请参阅我上面的日志。干杯!如果您将该编辑添加为答案并将其标记为已解决,这将是一件好事。这样,其他人就不必再调查这件事了。
class ApplicationController < ActionController::Base
before_filter :configure_permitted_parameters, if: :devise_controller?
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception



  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:name, :profile_name, :email, :password, :password_confirmation) }
  end
end
class ApplicationController < ActionController::Base
before_filter :configure_permitted_parameters, if: :devise_controller?
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception



  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:name, :profile_name, :email, :password, :password_confirmation) }
  end
end
def post_params
   params.require(::sign_up).permit(:name, :profile_name, :email, :password)
end