# Form.select wrong number of arguments (0 for 1)

**URL:** <https://www.ruby-forum.com/t/form-select-wrong-number-of-arguments-0-for-1/103761>\
**Category:** Rails\
**Created:** [May 10, 2007, 1:21am UTC](https://www.ruby-forum.com/t/form-select-wrong-number-of-arguments-0-for-1/103761 "2007-05-10T01:21:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RailsNewby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@RailsNewby](https://www.ruby-forum.com/u/RailsNewby)\
**Post date:** [May 10, 2007, 1:21am UTC](https://www.ruby-forum.com/t/form-select-wrong-number-of-arguments-0-for-1/103761/1 "2007-05-10T01:21:34Z")

</div>

I am new to rails, PHP background. I’m completely lost on this. I am  
trying to pull all of the albums from the albums table into a select  
box. But every time I run the script I get the “wrong number of  
arguments (0 for 1)” error. I’ve looked on other message boards and  
searched the web but I can’t seem to find the answer. I’ve tried several  
different variations of the form.select but they all lead to the same  
error.

Oh, and I am using Instant Rails and this is a new application to this  
install.

Here is the error:

ArgumentError in Admin#index

Showing app/views/admin/index.rhtml where line #3 raised:

wrong number of arguments (0 for 1)

Extracted source (around line #3):

1:   
2: \<%= @album\_list = Album.find(:all, :order =\> “album\_name”)  
3: form.select(:album\_name, @album\_list)  
4: %\>  
5:

Any help would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![RailsNewby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@RailsNewby](https://www.ruby-forum.com/u/RailsNewby)\
**Post date:** [May 10, 2007, 2:31am UTC](https://www.ruby-forum.com/t/form-select-wrong-number-of-arguments-0-for-1/103761/2 "2007-05-10T02:31:46Z")

</div>

Finally fixed it!

Needed to add the form\_for wrapper.

here is the new code.

\<% form\_for :album, :url =\> { :action =\> :create } do |form| %\>  
\<%= @album\_list = Album.find(:all, :order =\> “album\_name”)  
form.select(:id, @album\_list) %\>  
\<% end %\>

RailsNewby wrote:

> I am new to rails, PHP background. I’m completely lost on this. I am  
> trying to pull all of the albums from the albums table into a select  
> box. But every time I run the script I get the “wrong number of  
> arguments (0 for 1)” error. I’ve looked on other message boards and  
> searched the web but I can’t seem to find the answer. I’ve tried several  
> different variations of the form.select but they all lead to the same  
> error.
> 
> Oh, and I am using Instant Rails and this is a new application to this  
> install.
> 
> Here is the error:
> 
> ArgumentError in Admin#index
> 
> Showing app/views/admin/index.rhtml where line #3 raised:
> 
> wrong number of arguments (0 for 1)
> 
> Extracted source (around line #3):
> 
> 1:   
> 2: \<%= @album\_list = Album.find(:all, :order =\> “album\_name”)  
> 3: form.select(:album\_name, @album\_list)  
> 4: %\>  
> 5:
> 
> Any help would be greatly appreciated
