New field does now show in browser

Hi all

I just added a new field phone to form _form.html.erb created with:

rails generate migration AddPhoneTotickets phone:string

added with rake migraiton

and the new field does not show in the browser

new

<%= f.label :phone %>
<%= f.text_field :phone %>

old

<%= f.label :phone %>
<%= f.text_field :phone %>

On Aug 7, 2011, at 3:18 PM, Pepe S. wrote:

new
<%= f.label :phone %>

<%= f.text_field :phone %>

Did you add the form element in your view by hand? The migration alone
will not create it. If you added the field to the view, ran the
migration, and re-started the server, you should see the new field.

Walter

and re-started the server

Why would you need to restart the server? A server has no idea whether
databases have even been invented yet.

Did you ever add any phone numbers to your database?

On 7 August 2011 20:18, Pepe S. [email protected] wrote:

new
<%= f.label :phone %>

<%= f.text_field :phone %>

I don’t understand the code above, you say first that you have added a
new field, phone, to the database but this does not appear on the
form. Then you show ‘new’ and ‘old’ code where the only difference is
that one uses div and the other p. Can you clarify exactly what the
problem is and what is the code that is not working as you expect.

One tip, though, is to check the html of the page (View > Page Source
or similar in your browser) and check that this looks correct. If it
looks ok but is still not showing what you expect then copy the
complete html source and paste it into the w3c html validator and
check that you have not got any html errors.

Colin