我注意到我在column_name
中有一个关于table
的拼写错误而且我更改了它。此外,我更改了与params
相关联的所有代码和column
。
我将buisness_name
更改为business_name
,现在我收到此错误:
NoMethodError in Shops::RegistrationsController#create
undefined method `buisness_name' for #<Account:0x007fd2f259cac8> Did you mean? business_name business_name= business_name?
这是发生错误的创建方法,在行resource.save
:
def create
cookies[:email] = {:value => params[:shop][:email],
:domain => :all, :expires => 1.hour.from_now}
build_resource(sign_up_params)
resource.save
yield resource if block_given?
if resource.persisted?
if resource.active_for_authentication?
flash[:notice] = 'Successfully signed up'
respond_with resource, location: after_sign_up_path_for(resource)
else
flash[:notice] = "Signed up but #{resource.inactive_message}"
expire_data_after_sign_in!
respond_with resource, location: after_inactive_sign_up_path_for(resource)
end
else
clean_up_passwords resource
set_minimum_password_length
respond_with resource
end
end
我甚至重新启动了服务器,但仍然出现错误。我不知道为什么会这样......