원클릭으로
controller-routes
Add controllers and routes following project patterns for organizer namespaces, strong params, and Turbo
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Add controllers and routes following project patterns for organizer namespaces, strong params, and Turbo
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Create and manage Solid Queue background jobs with perform_now vs perform_later patterns
Perform deep critical analysis of changes with focus on performance vs sustainability trade-offs
Build Rails forms with Tailwind CSS, Turbo integration, and strong params validation
Write database migrations for PostgreSQL with PostGIS, UUID primary keys, enums, and counter caches
Create and modify Rails models following project conventions for STI, enums, validations, counter caches, and scopes
Create service objects in app/services/ using module namespaces for encapsulation
| name | controller-routes |
| description | Add controllers and routes following project patterns for organizer namespaces, strong params, and Turbo |
| license | MIT |
config/routes.rb with nested resourcesparams.expect# Public routes
resources :tournaments, only: %i[index show] do
resources :rounds, only: [] do
resources :pods, only: [] do
resources :results
end
end
resources :event_participants do
collection { get "me" }
end
end
# Organizer namespace (requires authentication + organizer role)
namespace :organizer do
root "tournaments#index"
resources :tournaments do
resources :rounds do
resources :pods do
resources :results
resources :infractions, only: %i[new create]
end
resources :seatings, only: [] do
patch :swap, on: :collection
end
end
resources :event_participants do
resources :infractions, only: %i[index destroy]
end
end
resources :leagues do
# same nesting as tournaments
post :create_pickup_pod, on: :member
end
end
root "events#index"
ApplicationController < ActionController::Base
└── Organizer::OrganizerController < ApplicationController
├── Organizer::TournamentsController
├── Organizer::LeaguesController
├── Organizer::CircuitsController
├── Organizer::RoundsController
├── Organizer::ResultsController
├── Organizer::InfractionsController
├── Organizer::SeatingsController
└── Organizer::EventParticipantsController
# app/controllers/organizer/organizer_controller.rb
module Organizer
class OrganizerController < ApplicationController
before_action :authorize_user!
def authorize_user!
redirect_to root_url, alert: "Not allowed" unless current_user.organizer?
end
def current_organizer
current_user.event_organizer
end
end
end
# frozen_string_literal: true
module Organizer
class ResourceController < OrganizerController
def index
@items = Model.for_organizer(current_organizer).preload(:associations)
end
def new
@item = Model.new
end
def create
@item = Model.create(resource_params.merge(event_organizer: current_organizer))
redirect_to [:organizer, @item], notice: "Created"
rescue => e
# Handle error
end
def edit
@item = Model.for_organizer(current_organizer).find(params[:id])
end
def update
@item = Model.for_organizer(current_organizer).find(params[:id])
@item.attributes = resource_params
if @item.save
redirect_to [:organizer, @item], notice: "Updated"
else
render :edit, status: :unprocessable_entity
end
end
def destroy
@item = Model.for_organizer(current_organizer).find(params[:id])
@item.destroy
redirect_to index_path, notice: "Deleted"
rescue ActiveRecord::RecordNotFound
redirect_to index_path, alert: "Not found"
end
private
def resource_params
params.expect(resource: %i[field1 field2])
end
end
end
params.expect(:model, [:fields]) instead of params.require(...).permit(...)params.expect(tournament: %i[name state])for_organizer(current_organizer) scope on models for scopingrescue ActiveRecord::RecordNotFound in show/edit/update → redirect to indexcurrent_organizer helper in OrganizerController base classapplicationlayout "modal", only: %i[new edit] in ApplicationController<%= turbo_frame_tag "modal", target: "_top" %> in layoutpreload or includes in index/show actions.preload(rounds: :pods, event_participants: { player: :user })config/routes.rb — Full routes structureapp/controllers/organizer/organizer_controller.rb — Auth base classapp/controllers/organizer/tournaments_controller.rb — Example controller with strong paramsapp/controllers/concerns/authentication.rb — Auth concern