Rails new project: error in generated controller

What am I doing wrong? :(((

rails new app
rails g controller test action
rails s

open localhost:3000/test/action

And:

ArgumentError in TestController#action

wrong number of arguments (1 for 0)
Rails.root: /Users/ffffffff/ggggggg

Application Trace | Framework Trace | Full Trace
app/controllers/test_controller.rb:2:in process' actionpack (3.1.1) lib/action_controller/metal.rb:193:indispatch’
actionpack (3.1.1) lib/action_controller/metal/rack_delegation.rb:
14:in dispatch' actionpack (3.1.1) lib/action_controller/metal.rb:236:inblock in
action’
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:65:in
call' actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:65:indispatch’
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:29:in
call' rack-mount (0.8.3) lib/rack/mount/route_set.rb:152:inblock in call’
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in block in recognize' rack-mount (0.8.3) lib/rack/mount/code_generation.rb:75:inoptimized_each’
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in recognize' rack-mount (0.8.3) lib/rack/mount/route_set.rb:141:incall’
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:532:in
call' sass (3.1.10) lib/sass/plugin/rack.rb:54:incall’
actionpack (3.1.1) lib/action_dispatch/middleware/
best_standards_support.rb:17:in call' rack (1.3.5) lib/rack/etag.rb:23:incall’
rack (1.3.5) lib/rack/conditionalget.rb:25:in call' actionpack (3.1.1) lib/action_dispatch/middleware/head.rb:14:incall’
actionpack (3.1.1) lib/action_dispatch/middleware/params_parser.rb:
21:in call' actionpack (3.1.1) lib/action_dispatch/middleware/flash.rb:243:incall’
rack (1.3.5) lib/rack/session/abstract/id.rb:195:in context' rack (1.3.5) lib/rack/session/abstract/id.rb:190:incall’
actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in
call' actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:inblock in call’
activesupport (3.1.1) lib/active_support/callbacks.rb:392:in
_run_call_callbacks' activesupport (3.1.1) lib/active_support/callbacks.rb:81:inrun_callbacks’
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:28:in
call' actionpack (3.1.1) lib/action_dispatch/middleware/reloader.rb:68:incall’
rack (1.3.5) lib/rack/sendfile.rb:101:in call' actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:incall’
actionpack (3.1.1) lib/action_dispatch/middleware/show_exceptions.rb:
47:in call' railties (3.1.1) lib/rails/rack/logger.rb:13:incall’
rack (1.3.5) lib/rack/methodoverride.rb:24:in call' rack (1.3.5) lib/rack/runtime.rb:17:incall’
activesupport (3.1.1) lib/active_support/cache/strategy/local_cache.rb:
72:in call' rack (1.3.5) lib/rack/lock.rb:15:incall’
actionpack (3.1.1) lib/action_dispatch/middleware/static.rb:53:in
call' railties (3.1.1) lib/rails/engine.rb:456:incall’
railties (3.1.1) lib/rails/rack/content_length.rb:16:in call' railties (3.1.1) lib/rails/rack/log_tailer.rb:14:incall’
rack (1.3.5) lib/rack/handler/webrick.rb:59:in service' .rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb: 111:inservice’
.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:70:in
run' .rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:183:inblock in start_thread’

On Oct 21, 7:25am, iabdulin [email protected] wrote:

What am I doing wrong? :(((

rails new app
rails g controller test action
rails s

open localhost:3000/test/action

Calling an action “action” is probably a bad idea - i’m guessing it’s
shadowing/being shadowed by an existing method of that name

Fred

You are using reserved words for names.