# Straightforward Q: Y params(:id) give wrong args error?

**URL:** <https://www.ruby-forum.com/t/straightforward-q-y-params-id-give-wrong-args-error/140152>\
**Category:** Rails\
**Created:** [June 11, 2008, 12:11pm UTC](https://www.ruby-forum.com/t/straightforward-q-y-params-id-give-wrong-args-error/140152 "2008-06-11T12:11:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [June 11, 2008, 12:11pm UTC](https://www.ruby-forum.com/t/straightforward-q-y-params-id-give-wrong-args-error/140152/1 "2008-06-11T12:11:38Z")

</div>

I have a real simple link here :  
\<%= link\_to ( image\_tag(“Simple\_Buttons/Download.png”,:alt=\>“Download”,  
:class=\>“generic\_button”),{  
:controller=\>‘letters’,  
:action =\> ‘download’,  
:id =\> letter})%\>

However it gives the following error [1] when I attempt to extract  
params[:id] in the action download:

ArgumentError in LettersController#download wrong number of arguments (1  
for 0)

Why is that?  
I am attaching my view, and controller as an attached zip (will be glad  
to send individual files).

[Detail 1]  
ArgumentError in LettersController#download

wrong number of arguments (1 for 0)

RAILS\_ROOT: C:/ruby/letter4sure  
Application Trace | Framework Trace | Full Trace

app/controllers/letters\_controller.rb:103:in `params' app/controllers/letters_controller.rb:103:in`download’  
-e:2:in `load’  
-e:2

c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:1158:in  
`send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in`perform\_action\_without\_filters’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/filters.rb:697:in  
`call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in`perform\_action\_without\_benchmark’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/benchmarking.rb:68:in  
`perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in`measure’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/benchmarking.rb:68:in  
`perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in`perform\_action\_without\_caching’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/caching.rb:678:in  
`perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in`cache’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/query\_cache.rb:8:in  
`cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in`perform\_action’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:524:in  
`send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in`process\_without\_filters’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/filters.rb:685:in  
`process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in`process’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:388:in  
`process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in`handle\_request’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:115:in  
`dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in`dispatch\_cgi’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:9:in  
`dispatch' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:76:in`process’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:74:in  
`synchronize' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:74:in`process’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:159:in  
`process_client' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:158:in`each’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:158:in  
`process_client' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in`run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in  
`initialize' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in`new’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in`initialize’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in  
`new' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in`run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:282:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:281:in`each’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:281:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/mongrel_rails:128:in`run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/command.rb:212:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/mongrel_rails:281 c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in`load’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:489:in  
`load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in`new\_constants\_in’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:489:in  
`load' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/mongrel.rb:64 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`gem\_original\_require’  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in`require’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in`require’  
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
script/server:3

app/controllers/letters\_controller.rb:103:in `params' app/controllers/letters_controller.rb:103:in`download’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:1158:in  
`send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in`perform\_action\_without\_filters’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/filters.rb:697:in  
`call_filters' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in`perform\_action\_without\_benchmark’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/benchmarking.rb:68:in  
`perform_action_without_rescue' c:/ruby/lib/ruby/1.8/benchmark.rb:293:in`measure’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/benchmarking.rb:68:in  
`perform_action_without_rescue' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in`perform\_action\_without\_caching’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/caching.rb:678:in  
`perform_action' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in`cache’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/query\_cache.rb:8:in  
`cache' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in`perform\_action’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:524:in  
`send' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in`process\_without\_filters’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/filters.rb:685:in  
`process_without_session_management_support' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in`process’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:388:in  
`process' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in`handle\_request’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:115:in  
`dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in`dispatch\_cgi’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:9:in  
`dispatch' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:76:in`process’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:74:in  
`synchronize' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/rails.rb:74:in`process’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:159:in  
`process_client' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:158:in`each’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:158:in  
`process_client' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in`run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in  
`initialize' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in`new’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:285:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in`initialize’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in  
`new' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel.rb:268:in`run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:282:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:281:in`each’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/configurator.rb:281:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/mongrel_rails:128:in`run’  
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/lib/mongrel/command.rb:212:in  
`run' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/mongrel_rails:281 c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in`load’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:489:in  
`load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in`new\_constants\_in’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:489:in  
`load' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/mongrel.rb:64 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`gem\_original\_require’  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in`require’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in`require’  
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
script/server:3  
-e:2:in `load’  
-e:2

Request

Parameters:

{“id”=\>“46”}

Show session dump

* * *

:csrf\_id: 7900bc735fcb236d1f8d6bd7308f3ce4  
:user\_id: 2  
flash: !map:ActionController::Flash::FlashHash {}

:expires\_at: 2008-06-11 06:26:13.137000 -04:00

Response

Headers:

{“cookie”=\>[],  
“Cache-Control”=\>“no-cache”}

---

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [June 11, 2008, 12:20pm UTC](https://www.ruby-forum.com/t/straightforward-q-y-params-id-give-wrong-args-error/140152/2 "2008-06-11T12:20:38Z")

</div>

Never Mind ! Ignore that first post: I found the error. Even though in  
the post I said params[:id] in the controller I was using params(:id)  
which is curved brackets instead of square brackets hence the error!

Thanks to all who read this!

Ather S. wrote:

> I have a real simple link here :  
> \<%= link\_to ( image\_tag(“Simple\_Buttons/Download.png”,:alt=\>“Download”,  
> :class=\>“generic\_button”),{  
> :controller=\>‘letters’,  
> :action =\> ‘download’,  
> :id =\> letter})%\>
> 
> However it gives the following error [1] when I attempt to extract  
> params[:id] in the action download:
