The attributes returned by "form_for" issue

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

Try using <%= text_field_tag “number” %> instead of f.text_field
On Jan 30, 2008 8:30 PM, myst_tt [email protected] wrote:

value?


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.

Thanks! I used to conside text_filed_tag should be only used in
“form_tag”…
:slight_smile:
Br,
MyST

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs