formotion
formotion copied to clipboard
Storing settings hash
Can you provide an example of how to store the settings hash so that it can be recalled and used as a template dynamically.
I have built an app that allows you to dynamically add field rows etc, but every time i try to save the hash it doesn't correctly store - perhaps it's just me being a Ruby noob.
I'd like to store the hash in a DB, or send it to a sever.
Gah this is a really hairy problem.
The way persistence works actually doesn't support templated rows (I confirmed this morning). I spent a few hours trying to make it fit but it'll take some time to re-think how persistence should work.
Basically persistence had a core assumption that the number of rows and sections would be equal between loading and saving forms, but adding fields will mess with that...
Sorry for the delay :(
Yikes - sounds like a pain in the ass :) keep me updated if you ever find out a way of doing it
FWIW - I'd second this one. It'd be brilliant if it was possible to use Formotion to create dynamic forms, and not just static forms defined from a hash. I can appreciate the difficulty of the persistence angle, but even if the form wasn't persistent, it'd be great if I could, say, provide a block that returns the nth row of the kth section, and then still get all of the other Formotion goodness.
@mattlanham Could you check out the pull request #77 and tell me if this solves your problem?