# 'wrong number of arguments' for text\_field?

**URL:** <https://www.ruby-forum.com/t/wrong-number-of-arguments-for-text-field/58154>\
**Category:** Rails\
**Created:** [April 19, 2006, 12:17am UTC](https://www.ruby-forum.com/t/wrong-number-of-arguments-for-text-field/58154 "2006-04-19T00:17:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnoldcano](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@arnoldcano](https://www.ruby-forum.com/u/arnoldcano)\
**Post date:** [April 19, 2006, 12:17am UTC](https://www.ruby-forum.com/t/wrong-number-of-arguments-for-text-field/58154/1 "2006-04-19T00:17:27Z")

</div>

This is probably something very simple but I can’t seem to figure out  
why I keep getting the ‘wrong number of arguments (1 for 2)’ error with  
the following code when I try to create a new record. If anyone can see  
what is going wrong here please help!

## new.rhtml

…  
\<%= start\_form\_tag :action =\> ‘new’ %\>  
\<%= render :partial =\> ‘form’ %\>  
\<%= image\_submit\_tag ‘disk.gif’ %\>  
\<%= end\_form\_tag %\>  
…

## \_form.rhtml

…  
\<%= text\_field ‘inventory’, ‘quantity’ %\>  
…

## inventories\_controller.rb

class InventoriesController \< ApplicationController  
…  
def new  
case request.method  
when :get  
@inventory = Inventory.new  
logger.debug @inventory.inspect  
when :post  
@inventory = Inventory.new(params[:inventory])  
if @inventory.save  
flash[:notice] = ‘Inventory was successfully created’  
render :action =\> ‘list’  
else  
render :action =\> ‘new’  
end  
end  
end  
…  
end

## development.log

Processing InventoriesController#new (for 216.110.65.241 at 2006-04-18  
17:11:10) [GET]  
Parameters: {“action”=\>“new”, “controller”=\>“inventories”}  
Inventory Columns (0.000387) SHOW FIELDS FROM inventories  
#\<Inventory:0xb793a0e0 @new\_record=true, @attributes={“created\_on”=\>nil,  
“status”=\>0, “part\_id”=\>0, “account\_id”=\>0, “branch\_id”=\>0,  
“updated\_on”=\>nil, “created\_by”=\>nil, “quantity”=\>1, “updated\_by”=\>nil}\>  
Rendering within layouts/application  
Rendering inventories/new

ActionView::TemplateError (wrong number of arguments (1 for 2)) on line  
#1 of app/views/inventories/\_form.rhtml:  
1: \<%= text\_field ‘inventory’, ‘quantity’ %\>

```
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/form_helper.rb:253:in 

```

`send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/form_helper.rb:253:in`value\_before\_type\_cast’  
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_view/helpers/form\_helper.rb:168:in  
`to_input_field_tag' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/form_helper.rb:76:in`text\_field’  
#{RAILS\_ROOT}/app/views/inventories/\_form.rhtml:1

---

<div class="post-metadata">

**Author:** ![arnoldcano](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@arnoldcano](https://www.ruby-forum.com/u/arnoldcano)\
**Post date:** [April 19, 2006, 12:39am UTC](https://www.ruby-forum.com/t/wrong-number-of-arguments-for-text-field/58154/2 "2006-04-19T00:39:24Z")

</div>

Arnold Cano wrote:

> ActionView::TemplateError (wrong number of arguments (1 for 2)) on line  
> #1 of app/views/inventories/\_form.rhtml:  
> 1: \<%= text\_field ‘inventory’, ‘quantity’ %\>
> 
> ```
> /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/form_helper.rb:253:in 
> 
> ```
> 
> `send’

Have you defined a “send” method in your Inventory model that is  
overriding the Ruby send method? If so, rename.

–  
We develop, watch us RoR, in numbers too big to ignore.
