Forum: Ruby on Rails User defined model and validations?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
rs (Guest)
on 2009-04-20 15:02
(Received via mailing list)
I am trying to wrap my head around an idea and would appreciate any
input from rails geniuses out there

I would like to allow an admin user to define data that should be in a
template, and then allow regular users to create instances of this
template and have it validated. ie:

- Template would have name, files and then x many fields of say "Text
max length 20 chars", "Image size 50x50", "Text 10 chars, not
required" etc.
- After the template is defined, end user would load it and save
implementations of that template.

The template would be easy to create say template has_many
template_fields.  But how can I load this template, validate it's data
and save the instances in another table(s)?

This would be similar to say allowing the admin to define their own
forms/fields/validations in the database, then saving instances of
these forms.  It seems like this would be a fairly common problem, any
ideas on this?  Is there some type of plugin that might help?

Thanks for any help
This topic is locked and can not be replied to.