repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource/comments_spec.rb | spec/unit/resource/comments_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe "ActiveAdmin Comments", type: :controller do
before do
load_resources { ActiveAdmin.register ActiveAdmin::Comment, as: "Comment" }
@controller = Admin::CommentsController.new
end
describe "#destroy" do
let(:user) { User.create! }
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource/pagination_spec.rb | spec/unit/resource/pagination_spec.rb | # frozen_string_literal: true
require "rails_helper"
module ActiveAdmin
RSpec.describe Resource, "Pagination" do
let(:application) { ActiveAdmin::Application.new }
let(:namespace) { Namespace.new(application, :admin) }
def config(options = {})
@config ||= Resource.new(namespace, Category, options)... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource/includes_spec.rb | spec/unit/resource/includes_spec.rb | # frozen_string_literal: true
require "rails_helper"
module ActiveAdmin
RSpec.describe Resource, "Includes" do
describe "#includes" do
let(:application) { ActiveAdmin::Application.new }
let(:namespace) { ActiveAdmin::Namespace.new application, :admin }
let(:resource_config) { ActiveAdmin::Resou... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource/page_presenters_spec.rb | spec/unit/resource/page_presenters_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Resource::PagePresenters do
let(:namespace) { ActiveAdmin::Namespace.new(ActiveAdmin::Application.new, :admin) }
let(:resource) { namespace.register(Post) }
it "should have an empty set of configs on initialize" do
expect(resou... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource/sidebars_spec.rb | spec/unit/resource/sidebars_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Resource::Sidebars do
let(:resource) do
namespace = ActiveAdmin::Namespace.new(ActiveAdmin::Application.new, :admin)
namespace.register(Post)
end
let(:sidebar) { ActiveAdmin::SidebarSection.new(:help) }
describe "adding ... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource/routes_spec.rb | spec/unit/resource/routes_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Resource::Routes do
let(:application) { ActiveAdmin.application }
let(:namespace) { application.namespace(:admin) }
context "when in the admin namespace" do
let(:config) { namespace.resource_for("Category") }
around do |ex... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource/attributes_spec.rb | spec/unit/resource/attributes_spec.rb | # frozen_string_literal: true
require "rails_helper"
module ActiveAdmin
RSpec.describe Resource, "Attributes" do
let(:application) { ActiveAdmin::Application.new }
let(:namespace) { ActiveAdmin::Namespace.new application, :admin }
let(:resource_config) { ActiveAdmin::Resource.new namespace, Post }
d... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource/scopes_spec.rb | spec/unit/resource/scopes_spec.rb | # frozen_string_literal: true
require "rails_helper"
module ActiveAdmin
RSpec.describe Resource, "Scopes" do
let(:application) { ActiveAdmin::Application.new }
let(:namespace) { Namespace.new(application, :admin) }
def config(options = {})
@config ||= Resource.new(namespace, Category, options)
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/helpers/scope_chain_spec.rb | spec/unit/helpers/scope_chain_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::ScopeChain do
include ActiveAdmin::ScopeChain
describe "#scope_chain" do
let(:relation) { double }
context "when Scope has a scope method" do
let(:scope) { ActiveAdmin::Scope.new :published }
it "should call the... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/authorization/controller_authorization_spec.rb | spec/unit/authorization/controller_authorization_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe "Controller Authorization", type: :controller do
let(:authorization) { controller.send(:active_admin_authorization) }
before do
load_resources { ActiveAdmin.register Post }
@controller = Admin::PostsController.new
allow(authorization)... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/authorization/index_overriding_spec.rb | spec/unit/authorization/index_overriding_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe "Index overriding", type: :controller do
before do
load_resources { ActiveAdmin.register Post }
@controller = Admin::PostsController.new
@controller.instance_eval do
def index
super do
render body: "Rendered from... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/authorization/authorization_adapter_spec.rb | spec/unit/authorization/authorization_adapter_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::AuthorizationAdapter do
let(:adapter) { ActiveAdmin::AuthorizationAdapter.new(double, double) }
describe "#authorized?" do
it "should always return true" do
expect(adapter.authorized?(:read, "Resource")).to eq true
end
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/namespace/register_resource_spec.rb | spec/unit/namespace/register_resource_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Namespace, "registering a resource" do
let(:application) { ActiveAdmin::Application.new }
let(:namespace) { ActiveAdmin::Namespace.new(application, :super_admin) }
let(:menu) { namespace.fetch_menu(:default) }
after { namespace.u... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/namespace/register_page_spec.rb | spec/unit/namespace/register_page_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Namespace, "registering a page" do
let(:application) { ActiveAdmin::Application.new }
let(:namespace) { ActiveAdmin::Namespace.new(application, :admin) }
let(:menu) { namespace.fetch_menu(:default) }
context "with no configuratio... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/namespace/authorization_spec.rb | spec/unit/namespace/authorization_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Resource, "authorization" do
let(:app) { ActiveAdmin::Application.new }
let(:namespace) { ActiveAdmin::Namespace.new(app, :admin) }
let(:auth) { double }
describe "authorization_adapter" do
it "should return AuthorizationAdap... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/view_helpers/method_or_proc_helper_spec.rb | spec/unit/view_helpers/method_or_proc_helper_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe MethodOrProcHelper do
let(:receiver) { double }
let(:context) do
obj = double receiver_in_context: receiver
obj.extend described_class
obj
end
describe "#call_method_or_exec_proc" do
it "should call the method in the context ... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/generators/install_spec.rb | spec/unit/generators/install_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe "ActiveAdmin Installation" do
it "creates active_admin.css" do
expect(Rails.root.join("app/assets/stylesheets/active_admin.css")).to exist
end
it "creates tailwind config file" do
expect(Rails.root.join("tailwind-active_admin.config.js"... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/views/components/paginated_collection_spec.rb | spec/unit/views/components/paginated_collection_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Views::PaginatedCollection do
describe "creating with the dsl" do
around do |example|
with_resources_during(example) { ActiveAdmin.register Post }
end
let(:view) do
view = mock_action_view
allow(view.reque... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/views/components/index_table_for_spec.rb | spec/unit/views/components/index_table_for_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Views::IndexAsTable::IndexTableFor do
describe "creating with the dsl" do
let(:collection) do
[Post.new(title: "First Post", starred: true)]
end
let(:active_admin_config) do
namespace = ActiveAdmin::Namespace.new... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/views/components/table_for_spec.rb | spec/unit/views/components/table_for_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Views::TableFor do
describe "creating with the dsl" do
let(:collection) do
[
Post.new(title: "First Post", starred: true),
Post.new(title: "Second Post"),
Post.new(title: "Third Post", starred: false)
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/views/components/panel_spec.rb | spec/unit/views/components/panel_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Views::Panel do
let(:arbre_panel) do
render_arbre_component do
panel "My Title" do
span("Hello World")
end
end
end
let(:panel_html) { Capybara.string(arbre_panel.to_s) }
it "should have a title h3" do... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/views/components/status_tag_spec.rb | spec/unit/views/components/status_tag_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Views::StatusTag do
# Helper method to build StatusTag objects in an Arbre context
def status_tag(*args)
render_arbre_component(status_tag_args: args) do
status_tag(*assigns[:status_tag_args])
end
end
describe "#tag... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/views/components/attributes_table_spec.rb | spec/unit/views/components/attributes_table_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Views::AttributesTable do
describe "creating with the dsl" do
let(:helpers) { mock_action_view }
let(:post) do
post = Post.new title: "Hello World", body: nil
allow(post).to receive(:id) { 1 }
allow(post).to r... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/views/components/index_list_spec.rb | spec/unit/views/components/index_list_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Views::IndexList do
let(:custom_index_as) do
Class.new(ActiveAdmin::Component) do
def build(page_presenter, collection)
add_class "index"
resource_selection_toggle_panel if active_admin_config.batch_actions.any... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/views/components/scopes_spec.rb | spec/unit/views/components/scopes_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Views::Scopes do
describe "the scopes list" do
let(:collection) { Post.all }
let(:active_admin_config) { ActiveAdmin.register(Post) }
let(:assigns) do
{
active_admin_config: active_admin_config,
collec... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/filters/active_spec.rb | spec/unit/filters/active_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Filters::Active do
let(:resource) do
namespace = ActiveAdmin::Namespace.new(ActiveAdmin::Application.new, :admin)
namespace.register(Post)
end
subject { described_class.new(resource, search) }
let(:params) do
::Actio... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/filters/active_filter_spec.rb | spec/unit/filters/active_filter_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Filters::ActiveFilter do
let(:namespace) do
ActiveAdmin::Namespace.new(ActiveAdmin::Application.new, :admin)
end
let(:resource) do
namespace.register(Post)
end
let(:user) { User.create! first_name: "John", last_name: "... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/filters/resource_spec.rb | spec/unit/filters/resource_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::Filters::ResourceExtension do
let(:resource) do
namespace = ActiveAdmin::Namespace.new(ActiveAdmin::Application.new, :admin)
namespace.register(Post)
end
it "should return a Hash" do
expect(resource.filters).to be_a Has... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/localizers/resource_localizer_spec.rb | spec/unit/localizers/resource_localizer_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.shared_examples_for "ActiveAdmin::Localizers::ResourceLocalizer" do
it "should use proper translation" do
string = ActiveAdmin::Localizers::ResourceLocalizer.t(action, model: model, model_name: model_name)
expect(string).to eq translation
end
it... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource_controller/polymorphic_routes_spec.rb | spec/unit/resource_controller/polymorphic_routes_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::ResourceController::PolymorphicRoutes, type: :controller do
let(:klass) { Admin::PostsController }
%w(polymorphic_url polymorphic_path).each do |method|
describe method do
let(:add_extra_routes) {}
let(:params) { {} }... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource_controller/data_access_spec.rb | spec/unit/resource_controller/data_access_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::ResourceController::DataAccess do
around do |example|
with_resources_during(example) do
config
end
end
let(:config) do
ActiveAdmin.register Post do
end
end
let(:http_params) do
{}
end
let(:params... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/spec/unit/resource_controller/decorators_spec.rb | spec/unit/resource_controller/decorators_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActiveAdmin::ResourceController::Decorators do
describe "#apply_decorator" do
let(:resource) { Post.new }
let(:controller) { controller_with_decorator(action, decorator_class) }
subject(:applied) { controller.apply_decorator(resource) }
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin.rb | lib/active_admin.rb | # frozen_string_literal: true
require "active_support/core_ext"
require "set"
require "ransack"
require "kaminari"
require "formtastic"
require "formtastic_i18n"
require "inherited_resources"
require "arbre"
begin
require "importmap-rails"
rescue LoadError
# importmap-rails is optional
end
module ActiveAdmin
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/activeadmin.rb | lib/activeadmin.rb | # frozen_string_literal: true
require_relative "active_admin"
| ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/generators/active_admin/views_generator.rb | lib/generators/active_admin/views_generator.rb | # frozen_string_literal: true
module ActiveAdmin
module Generators
class ViewsGenerator < Rails::Generators::Base
source_root File.expand_path("../../../", __dir__)
def copy_views
directory "app/views/layouts"
directory "app/views/active_admin", recursive: false
directory "app... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/generators/active_admin/resource/resource_generator.rb | lib/generators/active_admin/resource/resource_generator.rb | # frozen_string_literal: true
module ActiveAdmin
module Generators
class ResourceGenerator < Rails::Generators::NamedBase
desc "Registers resources with Active Admin"
source_root File.expand_path("templates", __dir__)
def generate_config_file
template "resource.rb.erb", "app/admin/#{fi... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/generators/active_admin/devise/devise_generator.rb | lib/generators/active_admin/devise/devise_generator.rb | # frozen_string_literal: true
require_relative "../../../active_admin/error"
require_relative "../../../active_admin/dependency"
module ActiveAdmin
module Generators
class DeviseGenerator < Rails::Generators::NamedBase
desc "Creates an admin user and uses Devise for authentication"
argument :name, ty... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/generators/active_admin/assets/assets_generator.rb | lib/generators/active_admin/assets/assets_generator.rb | # frozen_string_literal: true
module ActiveAdmin
module Generators
class AssetsGenerator < Rails::Generators::Base
source_root File.expand_path("templates", __dir__)
def install_assets
remove_file "app/assets/stylesheets/active_admin.scss"
remove_file "app/assets/javascripts/active_ad... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/generators/active_admin/page/page_generator.rb | lib/generators/active_admin/page/page_generator.rb | # frozen_string_literal: true
module ActiveAdmin
module Generators
class PageGenerator < Rails::Generators::NamedBase
source_root File.expand_path("templates", __dir__)
def generate_config_file
template "page.rb", "app/admin/#{file_path.tr('/', '_')}.rb"
end
end
end
end
| ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/generators/active_admin/page/templates/page.rb | lib/generators/active_admin/page/templates/page.rb | # frozen_string_literal: true
ActiveAdmin.register_page "<%= class_name %>" do
content do
# your content
end
end
| ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/generators/active_admin/install/install_generator.rb | lib/generators/active_admin/install/install_generator.rb | # frozen_string_literal: true
require "rails/generators/active_record"
module ActiveAdmin
module Generators
class InstallGenerator < ActiveRecord::Generators::Base
desc "Installs Active Admin and generates the necessary migrations"
argument :name, type: :string, default: "AdminUser"
hook_for :... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/generators/active_admin/install/templates/dashboard.rb | lib/generators/active_admin/install/templates/dashboard.rb | # frozen_string_literal: true
ActiveAdmin.register_page "Dashboard" do
menu priority: 1, label: proc { I18n.t("active_admin.dashboard") }
content title: proc { I18n.t("active_admin.dashboard") } do
div class: "px-4 py-16 md:py-32 text-center m-auto max-w-3xl" do
h2 "Welcome to ActiveAdmin", class: "text-... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource.rb | lib/active_admin/resource.rb | # frozen_string_literal: true
require_relative "view_helpers/method_or_proc_helper"
require_relative "resource/action_items"
require_relative "resource/attributes"
require_relative "resource/controllers"
require_relative "resource/menu"
require_relative "resource/page_presenters"
require_relative "resource/pagination"
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/component.rb | lib/active_admin/component.rb | # frozen_string_literal: true
module ActiveAdmin
class Component < Arbre::Component
end
end
| ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/menu_item.rb | lib/active_admin/menu_item.rb | # frozen_string_literal: true
require_relative "view_helpers/method_or_proc_helper"
module ActiveAdmin
class MenuItem
include Menu::MenuNode
include MethodOrProcHelper
attr_reader :html_options, :parent, :priority
# Builds a new menu item
#
# @param [Hash] options The options for the menu
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/version.rb | lib/active_admin/version.rb | # frozen_string_literal: true
module ActiveAdmin
VERSION = "4.0.0.beta19"
end
| ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/menu.rb | lib/active_admin/menu.rb | # frozen_string_literal: true
module ActiveAdmin
# Each Namespace builds up it's own menu as the global navigation
#
# To build a new menu:
#
# menu = Menu.new do |m|
# m.add label: 'Dashboard', url: '/'
# m.add label: 'Users', url: '/users'
# end
#
# If you're interested in configu... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/menu_collection.rb | lib/active_admin/menu_collection.rb | # frozen_string_literal: true
module ActiveAdmin
DEFAULT_MENU = :default
# A MenuCollection stores multiple menus for any given namespace. Namespaces delegate
# the addition of menu items to this class.
class MenuCollection
def initialize
@menus = {}
@build_callbacks = []
@built = false
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/application.rb | lib/active_admin/application.rb | # frozen_string_literal: true
require_relative "router"
require_relative "application_settings"
require_relative "namespace_settings"
module ActiveAdmin
class Application
class << self
def setting(name, default)
ApplicationSettings.register name, default
end
def inheritable_setting(na... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/collection_decorator.rb | lib/active_admin/collection_decorator.rb | # frozen_string_literal: true
module ActiveAdmin
# This class decorates a collection of objects delegating
# methods to behave like an Array. It's used to decouple ActiveAdmin
# from Draper and thus being able to use PORO decorators as well.
#
# It's implementation is heavily based on the Draper::CollectionDe... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/application_settings.rb | lib/active_admin/application_settings.rb | # frozen_string_literal: true
require_relative "settings_node"
module ActiveAdmin
class ApplicationSettings < SettingsNode
# The default namespace to put controllers and routes inside. Set this
# in config/initializers/active_admin.rb using:
#
# config.default_namespace = :super_admin
#
re... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/dynamic_settings_node.rb | lib/active_admin/dynamic_settings_node.rb | # frozen_string_literal: true
require_relative "dynamic_setting"
require_relative "settings_node"
module ActiveAdmin
class DynamicSettingsNode < SettingsNode
class << self
def register(name, value, type = nil)
class_attribute "#{name}_setting"
add_reader(name)
add_writer(name, type... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/authorization_adapter.rb | lib/active_admin/authorization_adapter.rb | # frozen_string_literal: true
module ActiveAdmin
# Default Authorization permissions for Active Admin
module Authorization
READ = :read
NEW = :new
CREATE = :create
EDIT = :edit
UPDATE = :update
DESTROY = :destroy
end
Auth = Authorization
# Active Admin's default authorization adapte... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/view_helpers.rb | lib/active_admin/view_helpers.rb | # frozen_string_literal: true
module ActiveAdmin
module ViewHelpers
# Require all ruby files in the view helpers dir
Dir[File.expand_path("view_helpers", __dir__) + "/*.rb"].each { |f| require f }
include MethodOrProcHelper
end
end
| ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/devise.rb | lib/active_admin/devise.rb | # frozen_string_literal: true
ActiveAdmin::Dependency.devise! ActiveAdmin::Dependency::Requirements::DEVISE
require "devise"
module ActiveAdmin
module Devise
def self.config
{
path: ActiveAdmin.application.default_namespace || "/",
controllers: ActiveAdmin::Devise.controllers,
pat... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/page.rb | lib/active_admin/page.rb | # frozen_string_literal: true
module ActiveAdmin
# Page is the primary data storage for page configuration in Active Admin
#
# When you register a page (ActiveAdmin.register_page "Status") you are actually creating
# a new Page instance within the given Namespace.
#
# The instance of the current page is ava... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/namespace.rb | lib/active_admin/namespace.rb | # frozen_string_literal: true
require_relative "resource_collection"
module ActiveAdmin
# Namespaces are the basic organizing principle for resources within Active Admin
#
# Each resource is registered into a namespace which defines:
# * the namespaceing for routing
# * the module to namespace controlle... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/views.rb | lib/active_admin/views.rb | # frozen_string_literal: true
module ActiveAdmin
module Views
# Loads all the classes in views/*.rb
Dir[File.expand_path("views", __dir__) + "/**/*.rb"].sort.each { |f| require f }
end
end
| ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/router.rb | lib/active_admin/router.rb | # frozen_string_literal: true
module ActiveAdmin
# @private
class Router
attr_reader :namespaces, :router
def initialize(router:, namespaces:)
@router = router
@namespaces = namespaces
end
def apply
define_root_routes
define_resources_routes
end
private
def de... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/callbacks.rb | lib/active_admin/callbacks.rb | # frozen_string_literal: true
module ActiveAdmin
module Callbacks
extend ActiveSupport::Concern
CALLBACK_TYPES = %i[before after].freeze
private
# Simple callback system. Implements before and after callbacks for
# use within the controllers.
#
# We didn't use the ActiveSupport callback... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/order_clause.rb | lib/active_admin/order_clause.rb | # frozen_string_literal: true
module ActiveAdmin
class OrderClause
attr_reader :field, :order, :active_admin_config
def initialize(active_admin_config, clause)
clause =~ /^([\w\.]+)(->'\w+')?_(desc|asc)$/
@column = $1
@op = $2
@order = $3
@active_admin_config = active_admin_conf... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/localizers.rb | lib/active_admin/localizers.rb | # frozen_string_literal: true
require_relative "localizers/resource_localizer"
module ActiveAdmin
module Localizers
class << self
def resource(active_admin_config)
ResourceLocalizer.from_resource(active_admin_config)
end
end
end
end
| ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/page_presenter.rb | lib/active_admin/page_presenter.rb | # frozen_string_literal: true
module ActiveAdmin
# A simple object that gets used to present different aspects of views
#
# Initialize with a set of options and a block. The options become
# available using hash style syntax.
#
# Usage:
#
# presenter = PagePresenter.new as: :table do
# # so... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/settings_node.rb | lib/active_admin/settings_node.rb | # frozen_string_literal: true
module ActiveAdmin
class SettingsNode
class << self
# Never instantiated. Variables are stored in the singleton_class.
private_class_method :new
# @return anonymous class with same accessors as the superclass.
def build(superclass = self)
Class.new(... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource_collection.rb | lib/active_admin/resource_collection.rb | # frozen_string_literal: true
module ActiveAdmin
# This is a container for resources, which acts much like a Hash.
# It's assumed that an added resource responds to `resource_name`.
class ResourceCollection
include Enumerable
extend Forwardable
def_delegators :@collection, :empty?, :has_key?, :keys, :... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/dsl.rb | lib/active_admin/dsl.rb | # frozen_string_literal: true
module ActiveAdmin
# The Active Admin DSL. This class is where all the registration blocks
# are evaluated. This is the central place for the API given to
# users of Active Admin.
#
class DSL
def initialize(config)
@config = config
end
# Runs the registration... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/batch_actions.rb | lib/active_admin/batch_actions.rb | # frozen_string_literal: true
ActiveAdmin.before_load do |app|
require_relative "batch_actions/resource_extension"
require_relative "batch_actions/controller"
# Add our Extensions
ActiveAdmin::Resource.send :include, ActiveAdmin::BatchActions::ResourceExtension
ActiveAdmin::ResourceController.send :include, ... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/scope.rb | lib/active_admin/scope.rb | # frozen_string_literal: true
module ActiveAdmin
class Scope
attr_reader :scope_method, :id, :scope_block, :display_if_block, :show_count, :default_block, :group
# Create a Scope
#
# Examples:
#
# Scope.new(:published)
# # => Scope with name 'Published' and scope method :published
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/pundit_adapter.rb | lib/active_admin/pundit_adapter.rb | # frozen_string_literal: true
ActiveAdmin::Dependency.pundit!
require "pundit"
# Add a setting to the application to configure the pundit default policy
ActiveAdmin::Application.inheritable_setting :pundit_default_policy, nil
ActiveAdmin::Application.inheritable_setting :pundit_policy_namespace, nil
module ActiveAdm... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/async_count.rb | lib/active_admin/async_count.rb | # frozen_string_literal: true
module ActiveAdmin
class AsyncCount
class NotSupportedError < RuntimeError; end
def initialize(collection)
raise NotSupportedError, "#{collection.inspect} does not support :async_count" unless collection.respond_to?(:async_count)
@collection = collection.except(:sel... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/form_builder.rb | lib/active_admin/form_builder.rb | # frozen_string_literal: true
# Provides an intuitive way to build has_many associated records in the same form.
module Formtastic
module Inputs
module Base
def input_wrapping(&block)
html = super
template.concat(html) if template.output_buffer && template.assigns[:has_many_block]
ht... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/dynamic_setting.rb | lib/active_admin/dynamic_setting.rb | # frozen_string_literal: true
module ActiveAdmin
class DynamicSetting
def self.build(setting, type)
(type ? klass(type) : self).new(setting)
end
def self.klass(type)
klass = "#{type.to_s.camelcase}Setting"
raise ArgumentError, "Unknown type: #{type}" unless ActiveAdmin.const_defined?(k... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/controller_action.rb | lib/active_admin/controller_action.rb | # frozen_string_literal: true
module ActiveAdmin
class ControllerAction
attr_reader :name
def initialize(name, options = {})
@name = name
@options = options
end
def http_verb
@options[:method] ||= :get
end
end
end
| ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/namespace_settings.rb | lib/active_admin/namespace_settings.rb | # frozen_string_literal: true
require_relative "dynamic_settings_node"
module ActiveAdmin
class NamespaceSettings < DynamicSettingsNode
# The default number of resources to display on index pages
register :default_per_page, 30
# The max number of resources to display on index pages and batch exports
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/filters.rb | lib/active_admin/filters.rb | # frozen_string_literal: true
require_relative "filters/dsl"
require_relative "filters/resource_extension"
require_relative "filters/formtastic_addons"
require_relative "filters/forms"
require_relative "helpers/optional_display"
# Add our Extensions
ActiveAdmin::ResourceDSL.send :include, ActiveAdmin::Filters::DSL
Act... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/engine.rb | lib/active_admin/engine.rb | # frozen_string_literal: true
module ActiveAdmin
class Engine < ::Rails::Engine
isolate_namespace ActiveAdmin
# Set default values for app_path and load_paths before running initializers
initializer "active_admin.load_app_path", before: :load_config_initializers do |app|
ActiveAdmin::Application.se... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/cancan_adapter.rb | lib/active_admin/cancan_adapter.rb | # frozen_string_literal: true
unless ActiveAdmin::Dependency.cancan? || ActiveAdmin::Dependency.cancancan?
ActiveAdmin::Dependency.cancan!
end
require "cancan"
# Add a setting to the application to configure the ability
ActiveAdmin::Application.inheritable_setting :cancan_ability_class, "Ability"
module ActiveAdmi... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource_dsl.rb | lib/active_admin/resource_dsl.rb | # frozen_string_literal: true
module ActiveAdmin
# This is the class where all the register blocks are evaluated.
class ResourceDSL < DSL
private
# Redefine sort behaviour for column
#
# For example:
#
# # nulls last
# order_by(:age) do |order_clause|
# [order_clause.to_sql... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/dependency.rb | lib/active_admin/dependency.rb | # frozen_string_literal: true
module ActiveAdmin
module Dependency
module Requirements
DEVISE = ">= 4.0", "< 5"
end
# Provides a clean interface to check for gem dependencies at runtime.
#
# ActiveAdmin::Dependency.rails
# => #<ActiveAdmin::Dependency::Matcher for rails 6.0.3.2>
#
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/sidebar_section.rb | lib/active_admin/sidebar_section.rb | # frozen_string_literal: true
module ActiveAdmin
class SidebarSection
include ActiveAdmin::OptionalDisplay
attr_accessor :name, :options, :block
def initialize(name, options = {}, &block)
@name = name.to_s
@options = options
@block = block
normalize_display_options!
end
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/inputs.rb | lib/active_admin/inputs.rb | # frozen_string_literal: true
module ActiveAdmin
module Inputs
extend ActiveSupport::Autoload
module Filters
extend ActiveSupport::Autoload
autoload :Base
autoload :StringInput
autoload :TextInput
autoload :DateRangeInput
autoload :NumericInput
autoload :SelectInput... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/error.rb | lib/active_admin/error.rb | # frozen_string_literal: true
module ActiveAdmin
# Exception class to raise when there is an authorized access
# exception thrown. The exception has a few goodies that may
# be useful for capturing / recognizing security issues.
class AccessDenied < StandardError
attr_reader :user, :action, :subject
de... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/csv_builder.rb | lib/active_admin/csv_builder.rb | # frozen_string_literal: true
module ActiveAdmin
# CSVBuilder stores CSV configuration
#
# Usage example:
#
# csv_builder = CSVBuilder.new
# csv_builder.column :id
# csv_builder.column("Name") { |resource| resource.full_name }
# csv_builder.column(:name, humanize_name: false)
# csv_builder.c... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/page_dsl.rb | lib/active_admin/page_dsl.rb | # frozen_string_literal: true
module ActiveAdmin
# This is the class where all the register_page blocks are evaluated.
class PageDSL < DSL
# Page content.
#
# The block should define the view using Arbre.
#
# Example:
#
# ActiveAdmin.register "My Page" do
# content do
# ... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/batch_actions/controller.rb | lib/active_admin/batch_actions/controller.rb | # frozen_string_literal: true
module ActiveAdmin
module BatchActions
module Controller
# Controller action that is called when submitting the batch action form
def batch_action
if action_present?
selection = params[:collection_selection] || []
inputs = JSON.parse(params[:ba... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/batch_actions/resource_extension.rb | lib/active_admin/batch_actions/resource_extension.rb | # frozen_string_literal: true
module ActiveAdmin
module BatchActions
module ResourceExtension
def initialize(*)
super
@batch_actions = {}
add_default_batch_action
end
# @return [Array] The set of batch actions for this resource
def batch_actions
batch_actio... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/batch_actions/views/selection_cells.rb | lib/active_admin/batch_actions/views/selection_cells.rb | # frozen_string_literal: true
require_relative "../../component"
module ActiveAdmin
module BatchActions
# Creates the toggle checkbox used to toggle the collection selection on/off
class ResourceSelectionToggleCell < ActiveAdmin::Component
builder_method :resource_selection_toggle_cell
def buil... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/batch_actions/views/batch_action_form.rb | lib/active_admin/batch_actions/views/batch_action_form.rb | # frozen_string_literal: true
require_relative "../../component"
module ActiveAdmin
module BatchActions
# Build a BatchActionForm
class BatchActionForm < ActiveAdmin::Component
def build(options = {}, &block)
options[:id] ||= "collection_selection"
# Open a form with two hidden input f... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/attributes.rb | lib/active_admin/resource/attributes.rb | # frozen_string_literal: true
module ActiveAdmin
class Resource
module Attributes
def default_attributes
resource_class.columns.each_with_object({}) do |c, attrs|
unless reject_col?(c)
name = c.name.to_sym
attrs[name] = (method_for_column(name) || name)
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/menu.rb | lib/active_admin/resource/menu.rb | # frozen_string_literal: true
module ActiveAdmin
class Resource
module Menu
# Set the menu options.
# To disable this menu item, call `menu(false)` from the DSL
def menu_item_options=(options)
if options == false
@include_in_menu = false
@menu_item_options = {}
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/scope_to.rb | lib/active_admin/resource/scope_to.rb | # frozen_string_literal: true
module ActiveAdmin
class Resource
module ScopeTo
# Scope this controller to some object which has a relation
# to the resource. Can either accept a block or a symbol
# of a method to call.
#
# Eg:
#
# ActiveAdmin.register Post do
# ... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/controllers.rb | lib/active_admin/resource/controllers.rb | # frozen_string_literal: true
module ActiveAdmin
class Resource
module Controllers
delegate :resources_configuration, to: :controller
# Returns a properly formatted controller name for this
# config within its namespace
def controller_name
[namespace.module_name, resource_name.plu... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/sidebars.rb | lib/active_admin/resource/sidebars.rb | # frozen_string_literal: true
require_relative "../helpers/optional_display"
module ActiveAdmin
class Resource
module Sidebars
def sidebar_sections
@sidebar_sections ||= []
end
def clear_sidebar_sections!
@sidebar_sections = []
end
def sidebar_sections_for(action... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/routes.rb | lib/active_admin/resource/routes.rb | # frozen_string_literal: true
module ActiveAdmin
class Resource
module Routes
# @param params [Hash] of params: { study_id: 3 }
# @return [String] the path to this resource collection page
# @example "/admin/posts"
def route_collection_path(params = {}, additional_params = {})
rout... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/pagination.rb | lib/active_admin/resource/pagination.rb | # frozen_string_literal: true
module ActiveAdmin
class Resource
module Pagination
# The default number of records to display per page
attr_accessor :per_page
# The default number of records to display per page
attr_accessor :max_per_page
# Enable / disable pagination (defaults to... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/action_items.rb | lib/active_admin/resource/action_items.rb | # frozen_string_literal: true
require_relative "../helpers/optional_display"
module ActiveAdmin
class Resource
module ActionItems
# Adds the default action items to a resource when it's initialized
def initialize(*args)
super
add_default_action_items
end
# @return [Arra... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/scopes.rb | lib/active_admin/resource/scopes.rb | # frozen_string_literal: true
module ActiveAdmin
class Resource
module Scopes
# Return an array of scopes for this resource
def scopes
@scopes ||= []
end
# Returns a scope for this object by its identifier
def get_scope_by_id(id)
id = id.to_s
scopes.find { |... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/includes.rb | lib/active_admin/resource/includes.rb | # frozen_string_literal: true
module ActiveAdmin
class Resource
module Includes
# Return an array of includes for this resource
def includes
@includes ||= []
end
end
end
end
| ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/belongs_to.rb | lib/active_admin/resource/belongs_to.rb | # frozen_string_literal: true
module ActiveAdmin
class Resource
class BelongsTo
class TargetNotFound < StandardError
def initialize(key, namespace)
super "Could not find #{key} in #{namespace.name} " +
"with #{namespace.resources.map(&:resource_name)}"
end
e... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
activeadmin/activeadmin | https://github.com/activeadmin/activeadmin/blob/b9d630ce22a739d57c9c8b9976807a370e4de140/lib/active_admin/resource/page_presenters.rb | lib/active_admin/resource/page_presenters.rb | # frozen_string_literal: true
module ActiveAdmin
class Resource
module PagePresenters
# for setting default css class in admin ui
def default_index_class
@default_index
end
# A hash of page configurations for the controller indexed by action name
def page_presenters
... | ruby | MIT | b9d630ce22a739d57c9c8b9976807a370e4de140 | 2026-01-04T15:38:25.641812Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.