0

在我的 ruby​​ Volt 项目中,我收到以下错误:

AttributeBinding Error: #<NoMethodError: 'undefined method `name' for nil'>

我知道它来自尝试访问模型上的 name 属性,而它是 nil。我的路线文件如下:

client '/practices/new', component: 'admin', controller: 'offices', action: 'new'

'new' 方法将模型分配给缓冲区,但在页面加载时不会调用它。有谁知道为什么?

4

1 回答 1

0

我的猜测是你指的是{{ name }}而不是{{ _name }}你的观点。尝试下划线表示法或使用字段定义Offices模型。name相关文档在这里

AttributeBinding如果我不对模型上未定义的属性使用下划线表示法,则会收到错误消息。

于 2015-12-07T09:44:31.687 回答