0

少し複雑なウィザードがあり、フォームへのエントリに基づいてユーザーをルーティングしたいと考えています。

次のように手順をリストしました。

steps :weight_loss_history, :health_conditions, :cancer, :weight_mindset, :diabetes, :diet_information, :heart,  :food_intake

...そして、私の更新およびルーティング機能は次のとおりです。

def update
    @remote = current_remote
    params[:remote][:step] = step
    atts = Remote.fix_attributes(params[:remote])
    @remote.attributes = atts # equal to large hash of params
    find_route(@remote)
end

def find_route(info)
    if info[:cancer]
        puts "cancer..." # I never see this in the console
        jump_to(:cancer)
    else
        render_wizard info
    end
end

Wicked を使用して、ユーザーの選択に基づいてユーザーをルーティングする適切な実装を持っている人はいますか?

4

1 に答える 1