how to use active admin layout in some non-admin part of my application? #640

sachin87 opened this Issue Oct 18, 2011 · 10 comments


None yet

9 participants

class PracticesController < ApplicationController

layout "active_admin"

def index


it generates error message

undefined local variable or method `view_factory' for #<#Class:0xb42187c:0xaec5d24>

Extracted source (around line #1):

1: render view_factory.layout

activeadmin (0.3.2) lib/active_admin/arbre/builder.rb:47:in method_missing' activeadmin (0.3.2) app/views/layouts/active_admin.html.arb:1:in__home_sachin__rvm_gems_ruby_______p__gems_activeadmin_______app_views_layouts_active_admin_html_arb__247324487_93145730'
actionpack (3.1.1) lib/action_view/template.rb:144:in block in render' activesupport (3.1.1) lib/active_support/notifications.rb:55:ininstrument'
actionpack (3.1.1) lib/action_view/template.rb:142:in render' actionpack (3.1.1) lib/action_view/renderer/template_renderer.rb:52:inrender_with_layout'
actionpack (3.1.1) lib/action_view/renderer/template_renderer.rb:38:in render_template' actionpack (3.1.1) lib/action_view/renderer/template_renderer.rb:12:inblock in render'
actionpack (3.1.1) lib/action_view/renderer/abstract_renderer.rb:22:in wrap_formats' actionpack (3.1.1) lib/action_view/renderer/template_renderer.rb:9:inrender'
actionpack (3.1.1) lib/action_view/renderer/renderer.rb:36:in `render_template'

ghost commented Oct 20, 2011



I don't believe this is possible yet, should I make this a feature request?

ghost commented Oct 21, 2011

yes. will be great if you can create a controller without a resource. the dashboard is not enough for this, because very often you must do some operations for non-models or for many models. so its better to have a misc_controller

Jurawa commented Sep 18, 2012


abarre commented Sep 28, 2012


oniram commented Dec 7, 2012



Everyone, please don't +1 an Issue that doesn't clearly define a problem or a goal.

If you want to separate your views into partials, it's the same easy render call in Rails, regardless whether you're using Active Admin. The only difference being that partials need to be in app/views/admin.

Especially now that you can create standalone AA pages, @sachin87's original concern is a bit out of date.

@pcreux, could you close this?

pcreux commented Dec 7, 2012

Sure I can!

@pcreux pcreux closed this Dec 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment