Death first time out

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

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

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.

Not sure what the best solution is.

Rename the field.

c.

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