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:in `dispatch'' actionpack (3.1.1) lib/action_controller/metal/rack_delegation.rb: 14:in `dispatch'' actionpack (3.1.1) lib/action_controller/metal.rb:236:in `block 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:in `dispatch'' 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:in `block 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:in `optimized_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:in `call'' actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:532:in `call'' sass (3.1.10) lib/sass/plugin/rack.rb:54:in `call'' actionpack (3.1.1) lib/action_dispatch/middleware/ best_standards_support.rb:17:in `call'' rack (1.3.5) lib/rack/etag.rb:23:in `call'' rack (1.3.5) lib/rack/conditionalget.rb:25:in `call'' actionpack (3.1.1) lib/action_dispatch/middleware/head.rb:14:in `call'' 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:in `call'' rack (1.3.5) lib/rack/session/abstract/id.rb:195:in `context'' rack (1.3.5) lib/rack/session/abstract/id.rb:190:in `call'' actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in `call'' actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block 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:in `run_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:in `call'' rack (1.3.5) lib/rack/sendfile.rb:101:in `call'' actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'' actionpack (3.1.1) lib/action_dispatch/middleware/show_exceptions.rb: 47:in `call'' railties (3.1.1) lib/rails/rack/logger.rb:13:in `call'' rack (1.3.5) lib/rack/methodoverride.rb:24:in `call'' rack (1.3.5) lib/rack/runtime.rb:17:in `call'' activesupport (3.1.1) lib/active_support/cache/strategy/local_cache.rb: 72:in `call'' rack (1.3.5) lib/rack/lock.rb:15:in `call'' actionpack (3.1.1) lib/action_dispatch/middleware/static.rb:53:in `call'' railties (3.1.1) lib/rails/engine.rb:456:in `call'' railties (3.1.1) lib/rails/rack/content_length.rb:16:in `call'' railties (3.1.1) lib/rails/rack/log_tailer.rb:14:in `call'' 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:in `service'' .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:in `block in start_thread'' -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-Oct-21 08:55 UTC
Re: rails new project: error in generated controller
On Oct 21, 7:25 am, iabdulin <ildar.abdu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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> 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:in `dispatch'' > actionpack (3.1.1) lib/action_controller/metal/rack_delegation.rb: > 14:in `dispatch'' > actionpack (3.1.1) lib/action_controller/metal.rb:236:in `block 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:in > `dispatch'' > 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:in `block 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:in > `optimized_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:in `call'' > actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:532:in > `call'' > sass (3.1.10) lib/sass/plugin/rack.rb:54:in `call'' > actionpack (3.1.1) lib/action_dispatch/middleware/ > best_standards_support.rb:17:in `call'' > rack (1.3.5) lib/rack/etag.rb:23:in `call'' > rack (1.3.5) lib/rack/conditionalget.rb:25:in `call'' > actionpack (3.1.1) lib/action_dispatch/middleware/head.rb:14:in `call'' > 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:in > `call'' > rack (1.3.5) lib/rack/session/abstract/id.rb:195:in `context'' > rack (1.3.5) lib/rack/session/abstract/id.rb:190:in `call'' > actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in > `call'' > actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in > `block 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:in > `run_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:in > `call'' > rack (1.3.5) lib/rack/sendfile.rb:101:in `call'' > actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in > `call'' > actionpack (3.1.1) lib/action_dispatch/middleware/show_exceptions.rb: > 47:in `call'' > railties (3.1.1) lib/rails/rack/logger.rb:13:in `call'' > rack (1.3.5) lib/rack/methodoverride.rb:24:in `call'' > rack (1.3.5) lib/rack/runtime.rb:17:in `call'' > activesupport (3.1.1) lib/active_support/cache/strategy/local_cache.rb: > 72:in `call'' > rack (1.3.5) lib/rack/lock.rb:15:in `call'' > actionpack (3.1.1) lib/action_dispatch/middleware/static.rb:53:in > `call'' > railties (3.1.1) lib/rails/engine.rb:456:in `call'' > railties (3.1.1) lib/rails/rack/content_length.rb:16:in `call'' > railties (3.1.1) lib/rails/rack/log_tailer.rb:14:in `call'' > 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:in `service'' > .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:in > `block in start_thread''-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You are using reserved words for names. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.