administrate
administrate copied to clipboard
undefined method `associative?' for nil:NilClass
-
What were you trying to do? Render show page in administrate dashboard
-
What did you end up with (logs, or, even better, example apps are great!)?
Showing /app_path/app/views/fields/has_many/_show.html.erb where line #21 raised:
undefined method `associative?' for nil:NilClass

I've check the associations between the model, dashboards and associated models and it looks right to me.
In the rails debugger the field looks like:
=> #<Administrate::Field::HasMany:0x00007fc3991eadc0 @attribute=:coates, @data=#<ActiveRecord::Associations::CollectionProxy [#<Coat id: 229, title: "brown jacket", description: ".".....
>>
I am guessing there is an issue between coat and my dashboard model but it looks ok to me.
The error isn't very helpful.
- What versions are you running?
- Rails
- rails (>= 5.2.1)
- administrate
- administrate (0.14.0)
- Rails
I noticed this: @attribute=:coates in the text you paste. Could it be that there is a typo in your SHOW_PAGE_ATTRIBUTES, and you are listing coats as "coates"?
If this is not the problem, we are going to need a bit more. Could you please provide the following?
- Full exception trace.
- Models.
- Dashboards.
Closing due to lack of activity.