Action not being called on page load

53 Views Asked by At

In my ruby Volt project, I am getting the following error:

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

I know that it is coming from trying to access the name attribute on the model while it is nil. My routes file is the following:

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

The method 'new' assigns the model to a buffer but it is not being called on the page load. Anyone know why?

1

There are 1 best solutions below

0
djboardman On

My guess is that you're referring to {{ name }} rather than {{ _name }} in your view. Try the underscore notation or define an Offices model with a name field. The docs on that are here.

I get the AttributeBinding error if I don't use the underscore notation on an attribute that's not defined on a model.