gregbell/active_admin — Issue #682: Overwriting a default action such as index generates exception undefined method `base' for nil:NilClass
Author: danpal
Created: 2011-10-26 01:29:41+00:00
State: open

Anywhere just try to overwrite the controller action such as index.

controller do
load_and_authorize_resource
skip_load_resource :only => :index

def index
begin
render #this throws a
rescue Exception => e
puts e.message
puts e.backtrace
end
end

The backtrace shows:
/Users/dani/.rvm/gems/ruby-1.9.2-p290@railsrc/gems/activeadmin-0.3.2/lib/active_admin/view_helpers/filter_form_helper.rb:177:in `column_for'

Line 177:
def column_for(method)
@object.base.columns_hash[method.to_s] if @object.base.respond_to?(:columns_hash)
end

@object should be a => MetaSearch::Searches:: but is nil
Because

# Helper method to render a filter form
def active_admin_filters_form_for(search, filters, options = {})

Is being called with search = nil thus the @object in FilterFormBuilder is never initialized.