Skip to content

Instantly share code, notes, and snippets.

@yoshitsugu
Created April 26, 2014 06:18
Show Gist options
  • Save yoshitsugu/11313090 to your computer and use it in GitHub Desktop.
Save yoshitsugu/11313090 to your computer and use it in GitHub Desktop.

Rails Wizard

  • 長い入力のときに、段階的に入力できるようにする(いわゆるウィザード形式)

wicked

  • 今のところこれ一択っぽい
  • https://github.com/schneems/wicked
  • stepsの名前をまず書く。
  • 各stepで、実際には (postのときは update ->) show が呼び出される
  • update, showのメソッドの中でcase step でそれぞれの手順を書いていく
  • 基本的にステップのURLの展開と、ステップ間の制御くらいしかしてくれない
    • 最後まで入力が完了したものを正式なデータとする場合は 別途modelで状態などをもって制御が必要
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment