a13n
AI 에이전트를 만들고 클라우드에서 실행합니다
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Convention-over-configuration admin panels for Ruby on Rails: CRUD, search, filters, scopes, actions, dashboards, imports, audit log and policy-based authorization, generated from your models.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Convention-over-configuration admin panel engine for Ruby on Rails. Build beautiful admin interfaces with minimal code.
Live demo · Demo source · Documentation · What's new in 0.7
The demo is Meridian Magazine, a Rails 8 app built with IronAdmin. Sign in as one of three users (an admin, an editor or an author; no password needed) and see how resource policies change what each role can do. Its source has the resources, dashboard, policies and theme behind it.
rails new JavaScript setup: importmap with Stimulus. IronAdmin installs
importmap-rails itself; its layout loads the admin JavaScript with
javascript_importmap_tags and registers its Stimulus controllers on window.Stimulus,
which bin/rails stimulus:install sets up.Add to your Gemfile:
gem "iron_admin"
gem "tailwindcss-rails"
Then run:
bundle install
rails generate iron_admin:install
The install generator will:
app/iron_admin/resources/ and app/iron_admin/dashboards/ directoriesconfig/initializers/iron_admin.rb/admin in your routesapp/assets/tailwind/application.cssIronAdmin uses Tailwind CSS v4 for all styling. The tailwindcss-rails gem handles
compilation. After running the install generator, your app/assets/tailwind/application.css
should include:
@import "tailwindcss";
@import "../builds/tailwind/iron_admin";
The second line imports IronAdmin's @source directives so the Tailwind compiler
scans the engine's views and components for CSS classes. Without it, the admin panel
will render unstyled.
If you're setting up manually (without the generator), run:
rails tailwindcss:build
Then verify that app/assets/builds/tailwind/iron_admin.css was created. If not,
check that tailwindcss-rails >= 4.3 is installed (4.3 added the tailwindcss:engines
task that writes this file) and that the engine gem is properly loaded.
For development, use bin/dev or rails tailwindcss:watch to recompile CSS on changes.
# config/initializers/iron_admin.rb
IronAdmin.configure do |config|
config.title = "My App Admin"
config.authenticate do |controller|
user = User.find_by(id: controller.session[:user_id])
controller.redirect_to "/login" unless user&.admin?
end
config.current_user do |controller|
User.find_by(id: controller.session[:user_id])
end
end
An app built with bin/rails generate authentication does not store the user id in
session[:user_id]. IronAdmin controllers inherit from ActionController::Base, so
the host's Authentication concern and Current.user are not available in this block.
Use the Rails 8 authentication generator example.
rails generate iron_admin:resource User
rails generate iron_admin:resource Product
rails generate iron_admin:resource Order
# app/iron_admin/resources/user_resource.rb
module IronAdmin
module Resources
class UserResource < IronAdmin::Resource
field :role, type: :badge, colors: { admin: :purple, user: :blue }
field :email, type: :text
searchable :name, :email
filter :role, type: :select, options: User.roles.keys
filter :created_at, type: :date_range
scope :admins, -> { where(role: :admin) }
scope :recent, -> { where("created_at > ?", 7.days.ago) }
index_fields :id, :name, :email, :role, :created_at
form_fields :name, :email, :role
menu priority: 1, icon: "users", group: "People"
action :lock, icon: "lock-closed", confirm: true do |record|
record.update!(locked_at: Time.current)
end
end
end
end
# app/iron_admin/dashboards/admin_dashboard.rb
module IronAdmin
module Dashboards
class AdminDashboard < IronAdmin::Dashboard
metric :total_users, format: :number do
User.count
end
metric :monthly_revenue, format: :currency do
Payment.where("created_at > ?", 30.days.ago).sum(:amount)
end
recent :users, limit: 5, scope: -> { order(created_at: :desc) }
recent :payments, limit: 5
end
end
end
Visit /admin and your admin panel is ready!
The four themes of the Meridian Magazine demo. The Theming Guide shows how to build your own.
The default look, Neutral, is a minimal light theme: zinc grays, white surfaces with 1px borders, the Inter typeface, a black primary button and an indigo accent. Change any of its properties, or register more themes. With two or more, the navbar shows a theme switcher that remembers each person's choice in a cookie:
# config/initializers/iron_admin.rb
IronAdmin.configure do |config|
config.theme do |t| # the default theme
t.btn_primary = "bg-emerald-700 text-white hover:bg-emerald-600 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-600"
end
config.register_theme(:midnight, label: "Midnight") do |t|
t.color_scheme = "dark"
t.main_bg = "bg-zinc-950"
t.card_bg = "bg-zinc-900"
# ... every property is listed in the theming guide
end
end
config.theme_resolver can pick the theme per user or per tenant, and your own components read
the request's theme with IronAdmin.current_theme. Neutral loads Inter from Google Fonts; set
font_stylesheet_url to nil to turn that request off. See the
Theming Guide, which includes a complete dark theme.
Full documentation is available at https://rubylab-app.github.io/iron_admin/ and in the docs directory:
After checking out the repo (use the Ruby in .ruby-version; IronAdmin needs Ruby >= 3.3):
bundle install
bundle exec rspec
bundle exec rubocop . .github/scripts
See CONTRIBUTING.md for details.
The gem is available as open source under the terms of the MIT License.