부모 티켓
1개 티켓

백로그

0
티켓 없음

할 일

0
티켓 없음

진행 중

0
티켓 없음

리뷰

1
보통 c352fd32
서브 티켓 [P3] Spec 편집 UI

Spec 편집 UI — Build::SpecsController + Turbo Frame 인라인 편집 + core_features 편집 + 테스트

## 목표 AI 생성 spec(one_line_definition, core_features, target_customer, revenue_model) 수정 가능 폼. Turbo Frame 인라인 편집. ## 현재 상태 - Build::SpecsController 스텁 (show, update) - 라우트: `resources :projects do resource :spec, only: [:show, :update] end` - Project: one_line_definition, core_features(jsonb array), target_customer, revenue_model, competitor_analysis(jsonb) ## 구현 사항 ### 1. Build::SpecsController ```ruby class Build::SpecsController < ApplicationController before_action :set_project before_action :authorize_owner! def show; end def update if @project.update(spec_params) redirect_to build_project_spec_path(@project), notice: "스펙이 수정되었습니다." else render :show, status: :unprocessable_entity end end private def set_project = @project = Project.find(params[:project_id]) def authorize_owner! redirect_to build_projects_path, alert: I18n.t("errors.messages.not_authorized") unless @project.user == Current.user end def spec_params params.require(:project).permit(:one_line_definition, :target_customer, :revenue_model, core_features: []) end end ``` ### 2. 뷰 (build/specs/show.html.erb) - **Turbo Frame 인라인 편집**: 각 필드를 turbo_frame_tag로 감싸기 - 읽기 모드: 값 표시 + "편집" 버튼 - 편집 모드: 폼 입력 + "저장"/"취소" 버튼 - 또는 전체 편집 폼 방식 (더 간단) **표시 필드:** - one_line_definition: 텍스트 입력 - core_features: 리스트 — 각 항목 편집/삭제 가능, "항목 추가" 버튼 - target_customer: 텍스트 입력 - revenue_model: 텍스트 입력 - competitor_analysis: 읽기 전용 표시 (jsonb 구조) **core_features 편집:** - jsonb array이므로 params에서 core_features: [] 형태로 받기 - 각 항목에 text_field + 삭제 버튼 - "항목 추가" 버튼 (Stimulus controller 또는 간단한 JS) - Stimulus nested_form_controller 패턴 ### 3. 다크 테마 - bg-bg, bg-surface, text-text-primary, bg-accent - 기존 Partial 활용 ### ⚠️ 주의 - build/specs/ 범위만 (developer-2는 services/toss/ 작업 중) - Project 모델 수정 불필요 - core_features가 jsonb array — strong params에서 array 허용 ### 테스트 - Build::SpecsController: show, update(성공/실패), 인증/소유자 - core_features 업데이트 확인 ### 완료 기준 - Spec show 페이지 - 인라인 편집 + 저장 - core_features 항목 추가/삭제 - bin/rails test 전체 통과

D
developer-1
25 days

완료 (30일)

0
티켓 없음