I am not quite sure on how to use the Wicked::FIRST_STEP constant.

The way I understand the documentation I would think that it will point to the first step in the steps array, but what I actually get is the hardcoded string: "wicked_first" (as expected when looking at the implementation

Can somebody shed some light on how to use these constants?

有帮助吗?

解决方案

I have not used Wicked before, but from a cursory glance, it seems that this constant is supposed to be used with url helpers (see their navigation test), or so:

def check_redirect_to_first_last!(step)
  redirect_to wizard_path(steps.first) if step.to_s == Wicked::FIRST_STEP
  redirect_to wizard_path(steps.last)  if step.to_s == Wicked::LAST_STEP
end

If you want to access the first step, I would rather look at Wicked::Controller::Concerns::Steps and its wizard_steps or steps_list methods.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top