How to apply activeadmin authentication to an external page?

I am using the activeadmin gem, which is going well, now I want to add my authentication to some external pages or as MVC, which you say to some action. do not mix it with actions that can be added from admin / users.rd files. these are actions that are outside the activeadmin side.

+4
source share
1 answer

To use Devise (which Active Admin uses for authentication) for a page in the same application but not the actual Active Admin page, I did the following:

on my routes .rb I added a new route:

devise_scope :admin_user do resources :products end 

then in my product_controller.rb I added a before_filter file to restrict access:

 class ProductsController < ApplicationController before_filter :authenticate_admin_user! 

Hope this helps!

+5
source

Source: https://habr.com/ru/post/1394347/


All Articles