gregbell/active_admin — Issue #690: The index for one of my models yields: undefined method `base' for nil:NilClass 
Author: bbatsov
Created: 2011-10-27 15:15:07+00:00
State: open

I've just migrated a project of mine from rails_admin to ActiveAdmin and I've encountered a problem that I cannot solve. I have the following simple model:

```ruby
class Page < ActiveRecord::Base
has_many :page_images, :dependent => :destroy

validates :title, :presence => true, :uniqueness => true
validates :content, :presence => true
validates :permalink, :presence => true, :uniqueness => true

accepts_nested_attributes_for :page_images, :allow_destroy => true

def to_param
permalink
end
end
```

With Rails 3.1 and the latest version of ActiveAdmin I get the following error when I try to access its admin index:

```
Rendered /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/bundler/gems/active_admin-18912f8df209/app/views/active_admin/resource/index.html.arb (22.1ms)
Completed 500 Internal Server Error in 399ms

ActionView::Template::Error (undefined method `base' for nil:NilClass):
1: render renderer_for(:index)
```

I haven't done any modifications to `admin/pages.rb` - it's empty. ActiveAdmin works fine with all of my other models, but I have absolutely no idea what is so special about this one. Any hints/help will be greatly appreciated! Thanks in advance!