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

<div class="field">
    <%= f.label :phone %><br />
    <%= f.text_field :phone %>
  </div>

old

<p>
    <%= f.label :phone %><br />
    <%= f.text_field :phone %>
  </p>

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

Did you ever add any phone numbers to your database?

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