我收到以下错误:
NoMethodError in Users#new Showing .../app/views/users/form/_new.haml where line #7 raised: undefined method `on' for #<ActiveModel::Errors:0x007fb599ec6610>@H_502_3@第7行中的代码是:
7: = errors_for user,:first_name@H_502_3@而application_helper.rb:
def errors_for(model,field) error = case errors = model.errors.on(field) ... end@H_502_3@‘on’是一个default method in ActiveRecord.为什么这不工作?