I am using rails to make a feature designed for uploading CSV's and then taking the CSV's and making rails objects w/ them (i.e. 1 csv row equates to an object in the database). Right now, this is a 2 step process.
I am using the wicked gem for this, and have success bouncing between pages for the forms. The structure seems to be functioning fine.
The problem is in all of the examples i have seen the authors are making a single model that is backed by a database record, and can use things like id's and the object's state to track progress in the form.
From my understanding, this is a standard Wicked
controller action with psuedo-code for what I am trying to accomplish
def show
if step == :step_one
# get the user_id for whose objects these belong to
# and get the CSV file
end
if step == :step_two
# EITHER
# output errors for user to fix
# output success
end
render_wizard
end
I guess my main question is, how can i track state and use forms (i do not have access to form_for
because it's not an object) in this process? And if Wicked isn't designed for this, how can I implement this in a multi-step form?
Any help for how to tackle this is immensely appreciated!