plutonium-nested-resources

Automate nested resource routes, query scoping, and URL generation for has_many and has_one associations.

68|10|Updated Jan 10, 2024
One-click install
npx skills add https://github.com/radioactive-labs/plutonium-core --skill plutonium-nested-resources
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: plutonium-nested-resources
Source: https://github.com/radioactive-labs/plutonium-core/tree/main/.claude/skills/plutonium-nested-resources
Command: npx skills add https://github.com/radioactive-labs/plutonium-core --skill plutonium-nested-resources

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Plutonium nested resources automates the setup and management of parent-child routes, scope enforcement, and URL generation, simplifying complex data relationships in admin portals.

Core Features & Use Cases

  • Automatic generation of nested routes for has_many and has_one associations with a nested_ prefix.
  • Automatic parent resolution and query scoping to ensure data isolation per parent.
  • URL generation utilities that produce correct routes for nested and singular resources across packages.

Quick Start

Register nested resources in your portal to enable parent-child routing and automatic URL generation.

Frequently Asked Questions about plutonium-nested-resources

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate nested routes for has_many and has_one associations in Rails?

You can automate nested routes for has_many and has_one associations by registering resources in a portal that automatically prefixes routes with nested_ and scopes queries to the parent. This ensures consistent UI routing and access control without manual route definitions.

What is parent scoping in Rails nested resources and how does it enforce data isolation?

Parent scoping automatically resolves the parent record and applies query scoping to enforce data isolation per parent. This mechanism ensures child resources are only accessible within their correct parent context, maintaining strict access control boundaries.

How do I generate correct URLs for nested and singular resources across different packages?

To generate correct URLs for nested and singular resources across packages, use built-in URL generation utilities that automatically resolve parent contexts. These utilities produce accurate route paths based on your resource registry configuration and association types.

Does this nested routing approach require a specific resource registry setup?

Yes, implementing automated nested routing requires a resource registry that supports register_resource blocks. This registry handles automatic parent resolution and policy-aware scoping needed to enforce parent context and generate correct routes.

Can I use automatic parent resolution for admin portals with complex data relationships?

Automatic parent resolution is designed specifically for admin portals with complex data relationships. It simplifies managing parent-child routes and scope enforcement by automatically handling query scoping and URL generation for has_many and has_one associations.