From: Phlip
Date: 2006-09-15T01:40:47+09:00
Subject: rails -> add a column -> NoMethodError in Admin#edit
[While I try to get on the Rails mailing list here...]
Rubies:
I am a Ruby on Rails newbie, and have been reading the book, "Agile Web
Development with Rails", by Thomas & Hansson.
I seem to be stuck on page 61. The shtick is we create a database table,
then go back and add a column. The column appears fine in my SQLite3
database, and I used its test fixture to populate the column.
Then to rebuild the table's admin interface, I invoke "ruby script/generate
scaffold Product Admin"... But the new column does not show up on the
/admin/show/1 page, and /admin/edit/1 complains like this:
----8<---------------------------------
NoMethodError in Admin#edit
Showing app/views/admin/_form.rhtml where line #17 raised:
undefined method `strength' for #
Extracted source (around line #17):
14: <%= text_field 'champ', 'account' %>
15:
16:
17: <%= text_field 'champ', 'strength' %>
18:
19:
Trace of template inclusion: /app/views/admin/edit.rhtml
----8<---------------------------------
Now because I naturally don't understand the entire stack yet, I don't know
how to work-around this, or how to fix it directly. Any help?
--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!