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,,, 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

<% form_for :user, :url => {:action => ‘create’} do |f| -%>

Protect Image:

7: <%= f.text_field :code%>


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


Ryan B.
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

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