# Rails -\> add a column -\> NoMethodError in Admin#edit

**URL:** <https://www.ruby-forum.com/t/rails-add-a-column-nomethoderror-in-admin-edit/68714>\
**Category:** Ruby\
**Created:** [September 14, 2006, 6:41pm UTC](https://www.ruby-forum.com/t/rails-add-a-column-nomethoderror-in-admin-edit/68714 "2006-09-14T18:41:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [September 14, 2006, 6:41pm UTC](https://www.ruby-forum.com/t/rails-add-a-column-nomethoderror-in-admin-edit/68714/1 "2006-09-14T18:41:00Z")

</div>

[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 #Champ:0xb742ca68

Extracted source (around line #17):

14: \<%= text\_field ‘champ’, ‘account’ %\>

  
15:  
16: 

Strength  
  
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?

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [September 14, 2006, 6:51pm UTC](https://www.ruby-forum.com/t/rails-add-a-column-nomethoderror-in-admin-edit/68714/2 "2006-09-14T18:51:03Z")

</div>

Phlip wrote:

> I am a Ruby on Rails newbie, and have been reading the book, “Agile Web  
> Development with Rails”, by Thomas & Hansson.

Oookay - the book told me I rarely need to restart the server. (It’s  
Webrick, so maybe it carries more state than it should!)

I bounce the server and the problem goes away.

A digression about Rails and this book: When Dave and … Dave wrote  
this  
book, they knew their target audience would consist mostly of developers  
experienced with writing websites using Brand X.

Under Brand X, you must write endless rendundant boilerplate code to get  
anything done. So for each website construction step, /Agile…Rails/  
typically announces all the stuff that you _don’t_ need to do, such as  
write  
database connection systems from scratch, construct SQL statements from  
huge  
strings, squeeze together MVC yourself…

…or bounce the friggin’ server. So now I know to bounce it after  
changing  
the schema. The book probably says that somewhere…
