# Newbea question

**URL:** <https://www.ruby-forum.com/t/newbea-question/127323>\
**Category:** Rails\
**Created:** [January 28, 2008, 8:53am UTC](https://www.ruby-forum.com/t/newbea-question/127323 "2008-01-28T08:53:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![casid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@casid](https://www.ruby-forum.com/u/casid)\
**Post date:** [January 28, 2008, 8:53am UTC](https://www.ruby-forum.com/t/newbea-question/127323/1 "2008-01-28T08:53:19Z")

</div>

I have t\_project model and want to get “id” and “from\_date” datas. how  
can I call them I didnt understand codes at all. I need to add the  
values to textbox ? could you pls check the model .

---

<div class="post-metadata">

**Author:** ![casid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@casid](https://www.ruby-forum.com/u/casid)\
**Post date:** [January 28, 2008, 9:09am UTC](https://www.ruby-forum.com/t/newbea-question/127323/2 "2008-01-28T09:09:24Z")

</div>

Ibrahim D. wrote:

> I have t\_project model and want to get “id” and “from\_date” datas. how  
> can I call them I didnt understand codes at all. I need to add the  
> values to textbox ? could you pls check the model .

Is “id” and “from\_date” the fields in table t\_projects? Do you want to  
insert data  
into this table or edit the current data?

---

<div class="post-metadata">

**Author:** ![casid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@casid](https://www.ruby-forum.com/u/casid)\
**Post date:** [January 28, 2008, 9:36am UTC](https://www.ruby-forum.com/t/newbea-question/127323/3 "2008-01-28T09:36:24Z")

</div>

Suneeta Km wrote:

> Ibrahim D. wrote:
> 
> > I have t\_project model and want to get “id” and “from\_date” datas. how  
> > can I call them I didnt understand codes at all. I need to add the  
> > values to textbox ? could you pls check the model .
> 
> Is “id” and “from\_date” the fields in table t\_projects? Do you want to  
> insert data  
> into this table or edit the current data?

“id” and “from\_data” are the fields in the table. I want to insert data  
from fields to textbox in view. is it possible ? I got two textbox one  
is for id one is for from\_date…

thanks for your reply…

---

<div class="post-metadata">

**Author:** ![casid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@casid](https://www.ruby-forum.com/u/casid)\
**Post date:** [January 28, 2008, 10:29am UTC](https://www.ruby-forum.com/t/newbea-question/127323/4 "2008-01-28T10:29:25Z")

</div>

Ibrahim D. wrote:

> Suneeta Km wrote:
> 
> > Ibrahim D. wrote:
> > 
> > > I have t\_project model and want to get “id” and “from\_date” datas. how  
> > > can I call them I didnt understand codes at all. I need to add the  
> > > values to textbox ? could you pls check the model .
> > 
> > Is “id” and “from\_date” the fields in table t\_projects? Do you want to  
> > insert data  
> > into this table or edit the current data?
> 
> “id” and “from\_data” are the fields in the table. I want to insert data  
> from fields to textbox in view. is it possible ? I got two textbox one  
> is for id one is for from\_date…
> 
> thanks for your reply…

It is possible… In the controller u first find the fields from the  
table and store it in an instance variable.

@t\_project= TProject.find(id) // id will be the id of the field u want  
to find

then in the view:  
\<%= text\_field “t\_project”, “id” %\>  
\<%= text\_field “t\_project”, “from\_data” %\>

this will populate the text box with the value in the table

---

<div class="post-metadata">

**Author:** ![casid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@casid](https://www.ruby-forum.com/u/casid)\
**Post date:** [April 25, 2008, 9:09am UTC](https://www.ruby-forum.com/t/newbea-question/127323/5 "2008-04-25T09:09:26Z")

</div>

> \<%= text\_field “t\_project”, “id” %\>  
> \<%= text\_field “t\_project”, “from\_data” %\>
> 
> this will populate the text box with the value in the table

thanks
