How ActiveAdmin Works with Existing Controllers

I find it difficult to understand how ActiveAdmin (http://activeadmin.info/) works with existing controllers

I have the following controllers

app/controllers/projects_controller.rb 

and I was able to successfully implement the ActiveAdmin interface according to my views in the above controller. But my question is: I added the following before_filter to my controller.

 class StaticContentsController < ApplicationController before_filter :list_content_types def index @static_contents = StaticContent.all end end 

But this filter does not seem to be executed, in fact I changed the code inside the index method to

 @static_contents = abc StaticContent.all 

The error due to the "abc" section is also given, but surprisingly my application is working with an error. I assume that "ActiveAdmin" reads controllers, my own, not existing ones.

this is my pointer action path

 http://localhost:3000/admin/static_contents 

and this is in development mode

Can someone help me understand how the controllers work with ActiveAdmin or am I missing something here?

My configs are listed below

rails (3.0.0) ruby โ€‹โ€‹1.8.7 activeadmin (0.3.2)

early

Sameera

+4
source share
1 answer

Activeadmin controllers do not match your application controllers, they are separate. The reason your code does not raise an exception from the activeadmin interface is because this code never hits. The documentation of the activeadmin controller indicates how to change the default actions of activeadmin.

+1
source

All Articles