[LRUG] Multi page form design gem for Rails?
Duncan Stuart
dgmstuart at gmail.com
Wed Feb 14 04:12:21 PST 2018
I don’t know of a gem - it’s a recurring problem, and a fiddly one since the concept of state is different from standard Rails CRUD.
We’ve used an approach of storing a hash of answers in the session: https://github.com/LBHackney-IT/maintain-my-home/blob/develop/app/models/selected_answer_store.rb , and elsewhere configuring the branching structure of a set of similar multiple-choice questions in YAML: https://github.com/LBHackney-IT/maintain-my-home/blob/develop/app/models/question_set.rb
This approach was borrowed from some gov.uk site (I forget which but you can find it in the commit history). Iirc that project additionaly had an object responsible for deciding what the next question should be, based on the previous answers.
Good luck!
Duncan Stuart
On Wed, 14 Feb 2018 at 09:17 Stuart Harrison < Stuart Harrison ( Stuart Harrison <pezholio at gmail.com> ) > wrote:
>
> Hey LRUG
>
>
> I’m about to embark on a project which has a couple of multi page branched
> forms, and, as it’s a common problem, I’m wondering if something exists
> that allows me to design a form either via a DSL or YAML, rather than
> having to reinvent the wheel each time. I used Surveyor (
> https://github.com/NUBIC/surveyor ) a few years ago, which kinda worked
> for me, but it did cause some pretty major headaches too, and now seems to
> be largely abandoned. I like the look of Wicked (
> https://github.com/schneems/wicked ) , which gets me part of the way there,
> but I don’t get that DSL-y way of designing the form and not having to
> worry about building the individual form parts in a view. Is there
> anything out there that supports this? Or are there any patterns that
> anyone else uses that would help this?
>
>
> Hope this makes sense
>
>
> Cheers
>
>
> Stu
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20180214/06594eac/attachment-0004.html>
More information about the Chat
mailing list