I am pretty new at rails and seem to be stuck on an issue.
Trying to find a way to get me app admin to create a form on our rails
app. These would include:
- Select form control type
- Select required validation
- Select price change if selected
Don't understand that either, sorry.
In fact I don't understand what you mean by the app admin *creating* a form.
Hi Colin, sorry I am probably not using proper terminology. I have a
subdomin type rails application. I am trying to get the administrator
users of the subdomain account to create an HTML form, something
similar to phpform.org.
Can anyone shed some details or point me in the correct direction?
In a nutshell I am trying to get the users in my app to create and use
web forms. I found a great jQuery example, I just have no idea how-to
save the form structure to db then render it and saving users answers/
options to the rendered form.
Not sure if it’s the best way, but here’s an idea. For each custom
form, use some combination of serialized db fields (one to hold the
form meta-data (field-types, field names, etc.) and a corresponding
field to hold the data.
Not sure if it's the best way, but here's an idea. For each custom form,
use some combination of serialized db fields (one to hold the form
meta-data (field-types, field names, etc.) and a corresponding field to
hold the data.
If you're using a relational database, I think it would actually be
better to have Form, Field, ValueSet, and Value models (and associated
tables):
class Form < AR::B
has_many :fields
has_many :records
class Field < AR::B
belongs_to :form
has_many :values
class Record < AR::B
belongs_to :form
# maybe belongs_to :user or something
has_many :values
class Value < AR::B
belongs_to :field
belongs_to :record
(Record is my ad-hoc term for one user's response, filling in all form
fields. There may be a better name. Also, some :throughs in there may
make life easier, depending on the use case.)
This might be a good candidate for a non-relational solution such as
MongoDB.
Not sure if it's the best way, but here's an idea. For each custom form,
use some combination of serialized db fields (one to hold the form
meta-data (field-types, field names, etc.) and a corresponding field to
hold the data.
If you're using a relational database, I think it would actually be
better to have Form, Field, ValueSet, and Value models (and associated
tables):
Er, sorry. I changed ValueSet to Record and missed that instance.