# Storing html form tags in the database

**URL:** <https://www.ruby-forum.com/t/storing-html-form-tags-in-the-database/190419>\
**Category:** Rails\
**Created:** [June 19, 2010, 6:51pm UTC](https://www.ruby-forum.com/t/storing-html-form-tags-in-the-database/190419 "2010-06-19T18:51:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [June 19, 2010, 6:51pm UTC](https://www.ruby-forum.com/t/storing-html-form-tags-in-the-database/190419/1 "2010-06-19T18:51:06Z")

</div>

Hey all,

I would like to capture all the typical form elements that a user is  
authorized to change, such as input type text, radio, check and  
textarea,etc - all of these html elements - and actually capture in the  
database by index. When current\_user modifies these values, if he/she is  
authorized, then, then the input field is updated in the database. Does  
anyone know a good way to store a list of all the form elements in a  
table so they could be updated as these fields are changed by users?

Thanks for any response

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [June 19, 2010, 11:35pm UTC](https://www.ruby-forum.com/t/storing-html-form-tags-in-the-database/190419/2 "2010-06-19T23:35:03Z")

</div>

John M. wrote:

> Hey all,
> 
> I would like to capture all the typical form elements that a user is  
> authorized to change, such as input type text, radio, check and  
> textarea,etc - all of these html elements - and actually capture in the  
> database by index. When current\_user modifies these values, if he/she is  
> authorized, then, then the input field is updated in the database. Does  
> anyone know a good way to store a list of all the form elements in a  
> table so they could be updated as these fields are changed by users?

This seems like a bad idea, but you haven’t explained your use case  
clearly enough to be certain. What are you really trying to accomplish  
here?

> Thanks for any response

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [June 19, 2010, 11:59pm UTC](https://www.ruby-forum.com/t/storing-html-form-tags-in-the-database/190419/3 "2010-06-19T23:59:09Z")

</div>

Marnen Laibow-Koser wrote:

> John M. wrote:
> 
> > Hey all,
> > 
> > I would like to capture all the typical form elements that a user is  
> > authorized to change, such as input type text, radio, check and  
> > textarea,etc - all of these html elements - and actually capture in the  
> > database by index. When current\_user modifies these values, if he/she is  
> > authorized, then, then the input field is updated in the database. Does  
> > anyone know a good way to store a list of all the form elements in a  
> > table so they could be updated as these fields are changed by users?
> 
> This seems like a bad idea, but you haven’t explained your use case  
> clearly enough to be certain. What are you really trying to accomplish  
> here?
> 
> > Thanks for any response
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

For example, when a user tries to edit a form element, such as a text  
input field, I want to capture who did in order to determine whether  
they are privileged to do it and if they are, when they make the change,  
I want to capture their user id and time in which it was updated.

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [June 20, 2010, 12:23am UTC](https://www.ruby-forum.com/t/storing-html-form-tags-in-the-database/190419/4 "2010-06-20T00:23:47Z")

</div>

John M. wrote:  
[…]

> For example, when a user tries to edit a form element, such as a text  
> input field, I want to capture who did in order to determine whether  
> they are privileged to do it and if they are, when they make the change,  
> I want to capture their user id and time in which it was updated.

So it sounds like it’s not really the HTML form elements you’re  
interested in, but the attributes of the object being edited. Right?

If so, then don’t drag the HTML into it.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
