0
我有一个复杂的向导,我想根据他们的条目路由到窗体的用户。Rails 4 +邪恶:使用参数来路由
我列出的步骤如下:
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
有没有人有一个良好的执行使用妖兽路线用户基于他们的选择?