# FORM creating based on input & database values

**URL:** <https://www.ruby-forum.com/t/form-creating-based-on-input-database-values/128148>\
**Category:** Rails\
**Created:** [February 5, 2008, 12:00pm UTC](https://www.ruby-forum.com/t/form-creating-based-on-input-database-values/128148 "2008-02-05T12:00:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KTU](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecae2f/32.png) [@KTU](https://www.ruby-forum.com/u/KTU)\
**Post date:** [February 5, 2008, 12:00pm UTC](https://www.ruby-forum.com/t/form-creating-based-on-input-database-values/128148/1 "2008-02-05T12:00:50Z")

</div>

Hi

What’s the way to create form based on the retrieved input from the  
post ?

Example:

I have action select:

def select  
@imitem = Imitem.find(params[:id])  
end

which reads ID (database ID) value from the post form. Now once I have  
that ID I need to find out  
if that IMITEM ID record on database has agreement=1 and if it is then  
create a FORM1 and if  
not then create a FORM2.

Do I need to make these definitions on controller section for SELECT  
action or do I make those on select.html page  
or is that even possible ?
