Back to list
radioactive-labs

plutonium-connect-resource

by radioactive-labs

Build production-ready Rails apps in minutes, not days. Convention-driven, fully customizable, AI-ready.

52🍴 7📅 Jan 23, 2026

SKILL.md


name: plutonium-connect-resource description: Connect existing resources to portals for web access

Connect Resource Skill

Use the pu:res:conn generator to connect resources to portals. This is required to expose resources through a portal's web interface.

Command Syntax

rails g pu:res:conn RESOURCE [RESOURCE...] --dest=PORTAL_NAME

Always specify resources directly - this avoids interactive prompts. The --src option is only needed for interactive mode and can be ignored.

Usage Patterns

Main App Resources (not in a package)

rails g pu:res:conn PropertyAmenity --dest=admin_portal
rails g pu:res:conn Post Comment Tag --dest=dashboard_portal

Namespaced Resources (from a feature package)

Use the full class name:

rails g pu:res:conn Blogging::Post --dest=admin_portal
rails g pu:res:conn Blogging::Post Blogging::Comment --dest=admin_portal

Multiple Resources at Once

rails g pu:res:conn Property PropertyAmenity Unit Tenant --dest=admin_portal

What Gets Generated

For a resource Post connected to admin_portal:

packages/admin_portal/
├── app/
│   ├── controllers/admin_portal/
│   │   └── posts_controller.rb      # Portal controller
│   ├── policies/admin_portal/
│   │   └── post_policy.rb           # Portal policy (if needed)
│   └── definitions/admin_portal/
│       └── post_definition.rb       # Portal definition (if needed)
└── config/
    └── routes.rb                    # Updated with register_resource

Generated Controller

class AdminPortal::PostsController < ::PostsController
  include AdminPortal::Concerns::Controller
end

Generated Policy

class AdminPortal::PostPolicy < ::PostPolicy
  include AdminPortal::ResourcePolicy

  def permitted_attributes_for_create
    [:title, :content, :user_id]
  end

  def permitted_attributes_for_read
    [:title, :content, :user_id, :created_at, :updated_at]
  end

  def permitted_associations
    %i[]
  end
end

Route Registration

# In packages/admin_portal/config/routes.rb
register_resource ::Post

Typical Workflow

# 1. Create resources (always specify --dest)
rails g pu:res:scaffold Post user:belongs_to title:string 'content:text?' --dest=main_app

# 2. Run migrations
rails db:migrate

# 3. Connect resources to portal (always specify --dest)
rails g pu:res:conn Post --dest=admin_portal

Important Notes

  1. Always specify resources directly - avoids prompts, no --src needed
  2. Always use the generator - never manually connect resources
  3. Run after migrations - the generator reads model columns for policy attributes
  4. Portal-specific customization - customize the generated policy/definition per-portal

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon