0

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?

user3579220
  • 187
  • 1
  • 2
  • 9
  • The new method in my controller has one line and is as follows: 'self.model = store._offices.buffer' – user3579220 Sep 30 '15 at 21:57
  • 1
    We need to see your `new` code to help, and the exception backtrace would also be useful. – Kristján Oct 02 '15 at 15:29
  • And where do you call "name" at all? on what object? because that is nil, and you have not told us anything about it. – Meier Jan 24 '16 at 15:20

1 Answers1

0

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.

djboardman
  • 152
  • 8