Rails Ruby3 Kwargs Dispatch Integration Debug

A Day of Debugging — Ruby 3.0 kwargs, Docker env, NAS Cron, SSH Special Characters

AI 에이전트가 Rails API 서버를 호출해서 티켓을 자동 배정하는 디스패처를 만들었다. 로직 자체는 간단한데 붙이는 과정에서 예상치 못한 곳에서 계속 막혔다. 겪은 것들을 기록해 둔다. 1. Ruby 3.0 kwargs 분리 — render_success(key: val) 가 왜 터지나 가장 오래 고생한 것. Rails 컨트롤러에서 응답 헬퍼를 이렇게 호출했다: render_success(tickets: tickets_list, pagination: pagination_data) 서버 로그에 찍힌 에러: ArgumentError - unknown keywords: :tickets, :pagination 헬퍼 정의는 이렇다: def render_success(data, status: :ok) render json: { success: true, data: data }, status: status end Ruby 2.x에서는 render_success(tickets: ..., pagination: ...) 호출 시 {tickets: ..., pagination: ...} 해시가 data에 들어갔다. ...

2026-01-02 · 5 min read · Seunghan
Hotwire Native Ios Tab Bar Patterns

Hotwire Native iOS Tab Bar App — HotwireTabBarController Implementation and Debugging

Here are the problems encountered when switching from a single Navigator to the HotwireTabBarController pattern while wrapping a Rails app with Hotwire Native. Bugs that were invisible in the simulator surfaced on TestFlight, and local dev environment settings got tangled – multiple points where time was wasted. 1. HotwireTabBarController Basic Structure Instead of a single Navigator, each tab has its own independent Navigator and WKWebView. // AppTab.swift enum AppTab: String, CaseIterable { case home, ai, request var systemImage: String { switch self { case .home: return "house" case .ai: return "message" case .request: return "checkmark.circle" } } var selectedSystemImage: String { switch self { case .home: return "house.fill" case .ai: return "message.fill" case .request: return "checkmark.circle.fill" } } var url: URL { let base = AppDelegate.baseURL switch self { case .home: return base.appendingPathComponent("dashboard") case .ai: return base.appendingPathComponent("conversations") case .request: return base.appendingPathComponent("service_requests") } } var hotwireTab: HotwireTab { HotwireTab( title: "", image: UIImage(systemName: systemImage)!, selectedImage: UIImage(systemName: selectedSystemImage)!, url: url ) } } // SceneController.swift core part private lazy var tabBarController: HotwireTabBarController = { let controller = HotwireTabBarController(navigatorDelegate: self) controller.load(AppTab.allCases.map(\.hotwireTab)) // Show only tab icons, remove text controller.viewControllers?.forEach { vc in vc.tabBarItem.title = nil vc.tabBarItem.imageInsets = UIEdgeInsets(top: 6, left: 0, bottom: -6, right: 0) (vc as? UINavigationController)?.delegate = self } return controller }() To remove tab titles and keep only icons, both tabBarItem.title = nil and imageInsets adjustment are needed. Setting only title to nil leaves the icon position unchanged, looking awkward. ...

2025-12-26 · 6 min read · Seunghan
Rails Devise Multistep Signup Resend Email

Rails 8 + Devise Multi-Step Signup & Resend Email Debugging

This documents the problems encountered while integrating role-based multi-step signup and the Resend email service on a Rails 8 + Inertia.js + Svelte 5 stack. 1. Role-Based Conditional Multi-Step Signup Form Requirements In a service with two user roles, the signup flow needed to differ: Role A: Basic info -> Work selection -> Organization info (3 steps) Role B: Basic info -> Work selection (2 steps, organization info unnecessary) Implementing Conditional Steps with Svelte 5 Runes Used $derived to dynamically handle total step count and button behavior based on role. ...

2025-12-20 · 4 min read · Seunghan
Rails Denormalized Cache Vs Count Query

Rails Denormalized Cache Column vs COUNT Query Mismatch: When Seed Data Creates 0%

I inserted demo seed data directly into a Rails app, and all percentages showed as 0% on the screen. Server logs were clean, the data was clearly in the DB, yet the numbers would not appear. Situation This was a Rails app with a voting feature. There is a screen showing vote counts per choice, calculating percentages against total votes and displaying them with progress bars and numbers. I needed to show a demo, so I fetched real-time data from an external API and inserted it as seed data. The approach was simple: ...

2025-12-16 · 4 min read · Seunghan
Mcp Flutter Rails System Category Debug

From MCP Tool Integration to Flutter Settings Toggle — Debugging Record

I created categories on the server side using MCP tools. But the new categories were not visible in the mobile app. It seemed like a simple problem, but the deeper I dug, the more layers were tangled together. The Beginning: Categories Created via MCP Not Showing in App I created system categories like dev/, memory on the server through MCP tools. Calling the API directly showed the data. Refreshing the app did not show them. ...

2025-12-13 · 5 min read · Seunghan
Hotwire Native Webview 8 Fixes

Hotwire Native WebView Debugging Collection — 8 Common Issues When Wrapping Rails WebView in Native Apps

When wrapping a Rails app with Hotwire Native (Turbo Native) to build iOS/Android native apps, there are quite a few things that work fine in the browser but behave strangely in WebView. Here are the issues encountered during actual development and the fixes applied, all in one place. Most can be resolved with a few lines of CSS or one line in the path configuration JSON. 1. Double-Tap Zoom / 300ms Click Delay Symptoms Double-tapping a button quickly zooms the screen. Even a single tap feels slightly delayed (about 300ms). ...

2025-11-25 · 5 min read · Seunghan
Rails Stimulus Controllers Lookbook Debug

Rails + Stimulus: Implementing 11 Controllers — Scroll, Carousel, Text Animation

Rails + ViewComponent + Lookbook 조합으로 컴포넌트 라이브러리를 만들 때, Stimulus 컨트롤러가 전부 스텁(빈 껍데기) 상태로 남아있는 상황을 맞닥뜨렸다. 13개 컨트롤러 중 3개만 동작하고 나머지 10개는 connect() {} 한 줄짜리였다. 이걸 전부 구현하면서 겪은 삽질을 정리한다. 구현 대상 총 11개 컨트롤러를 4단계로 나눠서 구현했다. Wave 컨트롤러 핵심 기술 1 TagInput, FileDropzone, CategoryTab DOM 조작, 드래그 이벤트 2 ScrollReveal, ScrollScale, VideoScrubbing, HorizontalScroll RAF 쓰로틀, IntersectionObserver, ResizeObserver 3 ScrambleText, RandomReveal RAF 애니메이션 루프, Fisher-Yates 셔플 4 ImageCarousel, CarouselContainer 드래그/터치, translateX 트랜지션 삽질 1: Lookbook 프리뷰에서 Stimulus가 아예 안 됨 가장 크게 막혔던 부분이다. 컨트롤러를 다 구현하고 Lookbook을 열었는데 아무 동작도 하지 않는다. 크롬 DevTools를 열어보니 data-controller 속성은 붙어있는데 Stimulus가 연결이 안 된 상태였다. ...

2025-11-18 · 6 min read · Seunghan
Rails Inertia Svelte Pet Avatar Image Color

Rails + Inertia + Svelte 5: Avatar Image/Color Selection Feature Implementation Struggles

This documents the problems encountered while implementing a pet profile avatar selection feature (image or color) on a Rails 8 + Inertia.js + Svelte 5 stack. Problem 1: Colors Were Not Stored in the DB Symptoms Looking at the initial code, pet card colors were displayed like this: const PET_COLORS = ['#f3caa1', '#b7ddf9', '#d3c8ff', '#c5d5f4', '#ffd9aa'] function petColor(index: number): string { return PET_COLORS[index % PET_COLORS.length] } Colors were determined by the order (index) in which pets were created. Since colors were not stored in the DB at all, even if a user changed a color, it would revert to the original on refresh. ...

2025-11-15 · 4 min read · Seunghan
Rails8 Deploy Lessons

5 Issues from First Rails 8 Deployment: Security, Migration, Compatibility

Rails 8 프로젝트를 처음 클라우드 서비스에 배포하면서 하루 동안 연속으로 5가지 문제를 만났다. 각각 독립적인 문제처럼 보였지만, 하나를 고치면 다음 문제가 드러나는 패턴이었다. 기록으로 남긴다. 1. 공개 저장소에 민감한 파일이 들어간 경우 Symptoms git log --all --full-history -- config/secrets.yml 같은 명령으로 확인해보면, 예전 커밋에 secret_key_base가 하드코딩된 파일, 앱 서명 키스토어 파일 등이 포함되어 있다. Solution: git filter-repo로 히스토리에서 완전 삭제 pip install git-filter-repo # 특정 파일들을 히스토리 전체에서 제거 git filter-repo --path config/secrets.yml --invert-paths git filter-repo --path app-release.keystore --invert-paths # 강제 푸시 git push origin main --force 주의: --force 는 팀 작업 중이라면 사전 공지 필수. 모든 팀원이 re-clone해야 한다. ...

2025-11-11 · 4 min read · Seunghan
Rails Missing Migration Sessions Table

Production DB Missing Table: schema.rb and Migration File Mismatch Incident

I received a report that sign-up and login were completely broken. The app just repeated “An unexpected error occurred.” Symptoms Sign-up attempt -> 500 Internal Server Error Login attempt -> same 500 Health check API -> 200 OK, DB connection normal The server was alive and DB was connected, but all authentication features were dead. Investigation Process Step 1: Check Server Status SSH in and check the Rails environment. rails runner "puts Rails.env" # => production rails runner "puts User.count" # => 13 Server normal, DB connection normal, user data exists. ...

2025-10-18 · 5 min read · Seunghan
Privacy Policy Terms Disclaimer Contact