0

I'm trying to create a survey app where the user can create surveys to ask others.

Scenario is basicaly like this and it's all done on the browser:

  1. User creates new form with as many questions and answer choices as they choose.
  2. Other users can view this form and fill it out, and the answers will be sent to the orignal creator of the form.
1
  • It's basically bad idea to create _from.html.rb each time user creates new survey. I think you should write info (schema) of a survey somewhere, e. g. to your database and then generate HTML for it based on the schema in your view. Commented Dec 8, 2016 at 8:28

1 Answer 1

1

You need dynamic forms to achieve this, there's an awesome gem called nested_form to easily created nested forms. The creator of this gem Ryan Bates has also created a Railscast session to demonstrate its usage and fortunately in that video the demo app is on survey. Here's the link to the video

https://www.youtube.com/watch?v=amT27SfNhKM

Here's the link to the gem

https://github.com/ryanb/nested_form

Hope that helps!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.