How it it possible to implement a wicked gem wizzard and add steps dynamically: - first step => select country - second step => select select city - other step => display shops listsbased on the previous 2 selections.
It seems like we can add it like this in the controller:
before_action :set_steps
before_action :setup_wizard
...
private
def set_steps
if params[:flow] == "twitter"
self.steps = [:ask_twitter, :ask_email]
elsif params[:flow] == "facebook"
self.steps = [:ask_facebook, :ask_email]
end
end
But I wonder if it is possible not create a new array of steps but adding the new ones to the previous ones, e.g.:
self.steps << Shop.some_query_based_on_country_and_city
More of that, in all the examples you know exactly the step names and their content, so you have a page per step. How to do if the content is the same but there are à lot of identical content steps (for example questions to answer)?
Any idea ? Thank you.