# Suggestions on how to support user-customizable views and forms?

**URL:** <https://www.ruby-forum.com/t/suggestions-on-how-to-support-user-customizable-views-and-forms/182923>\
**Category:** Rails\
**Created:** [February 4, 2010, 9:13pm UTC](https://www.ruby-forum.com/t/suggestions-on-how-to-support-user-customizable-views-and-forms/182923 "2010-02-04T21:13:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffV](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5fc32e/32.png) [@JeffV](https://www.ruby-forum.com/u/JeffV)\
**Post date:** [February 4, 2010, 9:13pm UTC](https://www.ruby-forum.com/t/suggestions-on-how-to-support-user-customizable-views-and-forms/182923/1 "2010-02-04T21:13:38Z")

</div>

I’ve searched the archives and googled and can’t find much on this. I  
need to allow an app admin the ability to define the layout of various  
views (and eventually various forms). The admin should be able to  
specify each field they want displayed and its row and column  
positions. Eventually, the admin can change the field’s text label,  
define it as read-only or writeable by users possessing a certain  
permission, etc… but I need help with the basic approach first,  
which is rendering a user-defined view.

I’m thinking the view code could look something like this:

\<% = @layout.title %\>

 \<% @layout.rows.each do |row| -%\> \<% row.columns do |col| -%\> \<% end -%\> \<% end -%\> 

| **\<%= col.label %\>** | \<%= col.model.send(col.method) %\> |

The “col” object contains the field’s label, db model class name, and  
model method (could be a column attribute or any model instance  
method).  
The “row” object, so far, is just an array of col objects.  
@layout would be constructed by the model based on definitions found  
in the db.

I don’t have the db design for this yet either.

Thanks for any and all suggestions.

Jeff
