# The attributes returned by "form\_for" issue

**URL:** <https://www.ruby-forum.com/t/the-attributes-returned-by-form-for-issue/127552>\
**Category:** Rails\
**Created:** [January 30, 2008, 11:01am UTC](https://www.ruby-forum.com/t/the-attributes-returned-by-form-for-issue/127552 "2008-01-30T11:01:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![myst\_tt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@myst\_tt](https://www.ruby-forum.com/u/myst_tt)\
**Post date:** [January 30, 2008, 11:01am UTC](https://www.ruby-forum.com/t/the-attributes-returned-by-form-for-issue/127552/1 "2008-01-30T11:01:14Z")

</div>

Hello, everybody:  
I have made a “form\_for” in a view returns the attributes value of  
a “user” model, such as user.login, user.email, user.name, ect.  
However, now I wanna add a new , e.g. “code”, into the form\_for  
tag, and return it to next action. The question is this attribute  
doesn’t belong to “user” model, it is simply a string i would like to  
deliver to next action. Once I try this , it errors: undefined  
method `number’ for #User:0xb5924cac.  
Is the “form\_for” tag merely able to convey model’s attribute  
value?

# ================ \<% form\_for :user, :url =\> {:action =\> ‘create’} do |f| -%\> 6:

Protect Image:  
  
7: \<%= f.text\_field :code%\>

Br,  
MyST

---

<div class="post-metadata">

**Author:** ![myst\_tt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@myst\_tt](https://www.ruby-forum.com/u/myst_tt)\
**Post date:** [January 30, 2008, 11:11am UTC](https://www.ruby-forum.com/t/the-attributes-returned-by-form-for-issue/127552/2 "2008-01-30T11:11:17Z")

</div>

Try using \<%= text\_field\_tag “number” %\> instead of f.text\_field  
On Jan 30, 2008 8:30 PM, myst\_tt [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> value?

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.

---

<div class="post-metadata">

**Author:** ![myst\_tt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@myst\_tt](https://www.ruby-forum.com/u/myst_tt)\
**Post date:** [January 30, 2008, 12:12pm UTC](https://www.ruby-forum.com/t/the-attributes-returned-by-form-for-issue/127552/3 "2008-01-30T12:12:45Z")

</div>

Thanks! I used to conside text\_filed\_tag should be only used in  
“form\_tag”…  
🙂  
Br,  
MyST
