multi-step form in rails 3
So first the user submit a form and will appear a new window in which you have a 5 step page
my aim is to create one submission procedure multi step form in which user can upload a file & etc..........
And s开发者_开发知识库o on.
It's much like an state-machine,
Don't know if my design is bad or if there's some correct way to do this?
Thanks.
I prefer using Jquery to handle this (via hiding and showing divs after various steps), that way there is one easy form with the multiple steps.
Server side multi step forms, afaik, are not available with Rails as they do not gel well with the whole RESTful architecture.
However you can create a key-value data store (memcache, flat file or a table) which has a key and stores data as value at each step in a hash. Keep pushing the data back to the server after each step and storing it in this hash. To go back to previous steps, you can devise the URL of the form as ///. Key can be a UUID.
精彩评论