# Death first time out

**URL:** <https://www.ruby-forum.com/t/death-first-time-out/76059>\
**Category:** Rails\
**Created:** [November 15, 2006, 5:06pm UTC](https://www.ruby-forum.com/t/death-first-time-out/76059 "2006-11-15T17:06:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RonOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b77776/32.png) [@RonOnRails](https://www.ruby-forum.com/u/RonOnRails)\
**Post date:** [November 15, 2006, 5:06pm UTC](https://www.ruby-forum.com/t/death-first-time-out/76059/1 "2006-11-15T17:06:38Z")

</div>

I’m new to RonR, so I thought I’d try something simple.

/tools ron$ script/generate model widget  
/tools ron$ rake db:migrate

where “001\_create\_widgets.rb”

is

"class CreateWidgets \< ActiveRecord::Migration  
def self.up  
create\_table :widgets do |t|  
# t.column :name, :string  
t.column “name”, :string  
t.column “function”, :string  
t.column “method”, :string  
t.column “created”, :datetime  
end  
end

def self.down  
drop\_table :widgets  
end  
end"

Everthing worked as advertised a table “widgets” was created in  
“tools\_develoment”  
I then invoked scafolding as follows:

/tools ron$ script/generate controller widget

with “widget\_controller.rb” containing:

“class WidgetController \< ApplicationController  
scaffold :widget  
end”

pointed my browser at [http://localhost:3000/widget](http://localhost:3000/widget)

I got the expected CRUD page

When I attemped to create a new widget the data base got updated ok  
when I checked later but from deep in the bowels of RonR I get this  
exception:

"ArgumentError in Widget#list

Showing  
Applications/Locomotive2/Bundles/rmagickRailsSept2006\_x86.locobundle/framework/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/templates/scaffolds/list.rhtml  
where line #13 raised:

wrong number of arguments (0 for 1)  
Extracted source (around line #13):

10: \<% for entry in instance\_variable\_get(“@#{@scaffold\_plural\_name}”)  
%\>  
11:   
12: \<% for column in @scaffold\_class.content\_columns %\>  
13: \<%= entry.send(column.name) %\>  
14: \<% end %\>  
15: \<%= link\_to “Show”, :action =\> “show#{@scaffold\_suffix}”,  
:id =\> entry %\>  
16: \<%= link\_to “Edit”, :action =\> “edit#{@scaffold\_suffix}”,  
:id =\> entry %\>  
RAILS\_ROOT: /Users/ron/tools/public/…/config/… "

Is this a bug or am I doing something wrong? Any ideas???

Thanks,  
RonOnRails

---

<div class="post-metadata">

**Author:** ![RonOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b77776/32.png) [@RonOnRails](https://www.ruby-forum.com/u/RonOnRails)\
**Post date:** [November 15, 2006, 6:02pm UTC](https://www.ruby-forum.com/t/death-first-time-out/76059/2 "2006-11-15T18:02:52Z")

</div>

The problem is your column called “method”. It’s clashing with the  
“method” method which exists on every Ruby object. See  
[http://corelib.rubyonrails.org/classes/Object.html#M001081](http://corelib.rubyonrails.org/classes/Object.html#M001081).

Not sure what the best solution is.

---

<div class="post-metadata">

**Author:** ![RonOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b77776/32.png) [@RonOnRails](https://www.ruby-forum.com/u/RonOnRails)\
**Post date:** [November 15, 2006, 6:40pm UTC](https://www.ruby-forum.com/t/death-first-time-out/76059/3 "2006-11-15T18:40:41Z")

</div>

Rename the field.

c.

---

<div class="post-metadata">

**Author:** ![RonOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b77776/32.png) [@RonOnRails](https://www.ruby-forum.com/u/RonOnRails)\
**Post date:** [November 15, 2006, 6:49pm UTC](https://www.ruby-forum.com/t/death-first-time-out/76059/4 "2006-11-15T18:49:04Z")

</div>

Yep that did it changed “method” to “means” and it worked like a charm.  
Thanks  
RonOn Rails
