# Form.select

**URL:** <https://www.ruby-forum.com/t/form-select/88305>\
**Category:** Rails\
**Created:** [March 9, 2007, 4:01pm UTC](https://www.ruby-forum.com/t/form-select/88305 "2007-03-09T16:01:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [March 9, 2007, 4:01pm UTC](https://www.ruby-forum.com/t/form-select/88305/1 "2007-03-09T16:01:30Z")

</div>

Hi,

I’m getting a “wrong number of arguments (0 for 1)” from my view when  
using form.select()  
I could not find anything helpful in the API docs.

\<%= @lists = Number.find(:all, :order =\> “list”, :conditions =\>  
"company = ‘monsieur\_martin’ ").map {|u| [u.list, u.id] } %\>  
\<%= form.select(:list, @lists) %\>

When checking the first line in console, it returns every list.

> > @lists = Number.find(:all, :order =\> “list”, :conditions =\>  
> > “company = 'monsieur\_martin “).map {|u| [u.list] }  
> > =\> [[””], [“gutta”]]

> > form.select(:list, @lists)  
> > NameError: undefined local variable or method `form’ for  
> > #Object:0xb7f4a9f4  
> > from (irb):20

I’m running Rails 1.2.2. Any suggestions to what I do wrong, or which  
pages I should read better in the API? 🙂

Best Regards,  
Martin S.

---

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [March 9, 2007, 4:33pm UTC](https://www.ruby-forum.com/t/form-select/88305/2 "2007-03-09T16:33:40Z")

</div>

Hi Martin,

Martin S. wrote:

> > > form.select(:list, @lists)  
> > > NameError: undefined local variable or method `form’ for  
> > > #Object:0xb7f4a9f4  
> > > from (irb):20
> 
> I’m running Rails 1.2.2. Any suggestions to what I do wrong, or which  
> pages I should read better in the API? 🙂

This doesn’t address the problem you’re having per se, but I thought you  
should know that you’re definitely not going to be able to test a Rails  
problem in irb. irb is interactive Ruby, not Rails. I don’t know  
whether  
you can test a form interactively, but if you can, you’re going to have  
to  
be using script\console which loads Rails and your development  
environment,  
not irb. Personally, I’d be using a sandbox app to debug a problem with  
a  
view.

Best regards,  
Bill
