3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/action_admin/routes.rb', line 3
def authenticate_admin(resource, options={})
space = options.fetch :namespace, :admin
path = options.fetch :path, "#{space}/#{resource}"
model = "#{resource}".pluralize
names = { sign_in: 'login', sign_out: 'logout', sign_up: 'signup', edit: 'profile' }
options = { path: path, path_names: names, module: 'action_admin/devise' }.merge(options)
devise_for :"#{model}", options
authenticate resource do
namespace space do
yield
end
end
end
|