I’m trying to write my first app in rails (no better way to learn than
to do). I did my first migration to create the initial table, which
worked fine. I generated the scaffold and added one new line item (a
workout) to the database no problem.
I then wanted to add some more fields to the database table, so I built
another migration…
class AddFields < ActiveRecord::Migration
def self.up
add_column :workouts, :weight, :text
add_column :workouts,:maxheart, :integer
add_column :workouts,:minheart, :integer
add_column :workouts,:avgheart, :integer
add_column :workouts,:timehour, :integer
add_column :workouts,:timemin, :integer
add_column :workouts,:timesec, :integer
end
def self.down
remove_column :workouts,:weight
remove_column :workouts,:maxheart
remove_column :workouts,:minheart
remove_column :workouts,:avgheart
remove_column :workouts,:timehour
remove_column :workouts,:timemin
remove_column :workouts,:timesec
end
end
and ran rake, which worked fine. But when I go to the ‘new’ action,
those fields do NOT show up. They are in fact in the database, because I
logged into mysql and looked, and they show up in the list view as empty
fields.
Am I missing a step to get them to show?