0
我正在尝试向我的编辑用户部分添加一些其他字段。在应用程序控制器中,我一直在寻找强大的参数。它工作时,我只有附加的名称字段,但现在我添加额外的领域,它是抛出以下错误,我不知道我需要修改这里来解决这个问题。应用程序控制器在rails中用于设计帐户更新
/application_controller.rb:12: syntax error, unexpected ',', expecting keyword_end ....for(:account_update) << :name, :line1, :line2, :town, :coun... ...^
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) << :name
devise_parameter_sanitizer.for(:account_update) << :name, :line1, :line2, :town, :county, :postcode
end
end
感谢这个伟大的工程!你能给我任何解释,说明这是如何工作的?再次感谢! – user3684357 2014-08-28 10:21:11
阅读关于devise的详细信息https://github.com/plataformatec/devise – VDN 2014-08-28 10:28:23