My below code
ActiveAdmin.register Question do belongs_to :topic, :optional => true controller do def index @topic = Topic.find_by_id params[:topic_id] if @topic @questions = @topic.questions render 'settings/questions/_by_admin', :layout => 'active_admin' return end end end end
throws
NoMethodError in Admin/questions
Display
/home/amol/.rvm/gems/ ruby-1.9.2-p290@xxx /gems/activeadmin-0.5.0/app/views/layouts/active_admin.html.arb where line # 1 is raised:
undefined `base 'method for nil: NilClass
Extracted source (around line # 1):
1: insert_tag view_factory.layout
any idea? what's going on here. The stack trace does not point to any of my code files.
What I want here if @topic is present then I want my view to be different by default.
source share