redirect on asking for step '1' ?
jnicho02 opened this issue · 2 comments
Using a path helper in a view to link to my project 'write' wizard I tried: <%= link_to 'write', project_write_path(@project) %> which points to /projects/1/write/1 giving an InvalidStepError
passing in the first step name works: <%= link_to 'write', project_write_path(@project, :review_site_details) %> points to /projects/1/write/review_site_details
Question: should /projects/1/write/1 not just automagically repoint itself to the first step in the controller rather than giving an error. Otherwise I believe I have to deliberately name the first step in links.
should /projects/1/write/1 not just automagically repoint itself
No. Is there something in the documentation that made you think it would do so? We should update the docs if that's the case.
Otherwise I believe I have to deliberately name the first step in links.
Correct, or use the "index" action of that controller which auto redirects to the first step. So going to /projects/1/write
should send you to /projects/1/write/review_site_details
. You can also use the first step constant as documented here https://github.com/schneems/wicked#keywords