Skip to content

Instantly share code, notes, and snippets.

@takahashim
Created June 16, 2025 09:20
Show Gist options
  • Save takahashim/d4eec7a6a09d213617f2e2ae4531c926 to your computer and use it in GitHub Desktop.
Save takahashim/d4eec7a6a09d213617f2e2ae4531c926 to your computer and use it in GitHub Desktop.
> 質問です。ProposalStateを編集する画面はありますか?ない場合、どうやれば変更できるでしょうか
⏺ ProposalStateを編集する画面について調査します。
⏺ Search(pattern: "proposal_states", path: "../decidim/decidim-proposals", include: "*controller*")
⎿  Found 1 file (ctrl+r to expand)
⏺ Read(../decidim/decidim-proposals/app/controllers/decidim/proposals/admin/proposal_states_controller.rb)
⎿  Read 87 lines (ctrl+r to expand)
⏺ ProposalStatesControllerが存在します!ルーティングを確認してみます:
⏺ Search(pattern: "proposal_states", path: "../decidim/decidim-proposals", include: "*routes*")
⎿  Found 0 files
⏺ Read(../decidim/decidim-proposals/config/routes.rb)
⎿  Error: File does not exist. Current working directory: /Users/maki/git/dc/decidim-cfj
⏺ Search(pattern: "routes", path: "../decidim/decidim-proposals", include: "*.rb")
⎿  Found 16 files (ctrl+r to expand)
⏺ Read(../decidim/decidim-proposals/lib/decidim/proposals/admin_engine.rb)
⎿  Read 64 lines (ctrl+r to expand)
⏺ ProposalState編集画面は存在します!
アクセス方法
管理画面のURL:
/admin/participatory_processes/[process_slug]/components/[component_id]/manage/proposal_states
手順
1. 管理画面にアクセス
- 管理者でログイン
- 管理画面 → 参加プロセス → [対象プロセス] → コンポーネント → [提案コンポーネント] → 管理
2. ProposalState管理画面
- URL: /admin/.../manage/proposal_states
- 新規作成: Newボタン
- 編集: 各状態のEditリンク
- 削除: Deleteボタン
利用可能な機能
ProposalStatesController (39行目のroutes)では以下の機能が提供されています:
- index: 状態一覧表示
- new/create: 新しい状態の作成
- edit/update: 既存状態の編集
- destroy: 状態の削除
現在の状況で試す方法
1. 既存状態がある場合:
bin/rails runner "puts Decidim::Proposals::ProposalState.all.map{|s| \"Component #{s.component_id}: #{s.id} - #{s.token}\"}"
2. 管理画面で直接アクセス:
- ブラウザで管理画面の提案コンポーネント管理に移動
- /proposal_statesパスを追加してアクセス
これで管理画面からProposalStateを作成・編集・削除できるはずです!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment