# FormOptionsHelper select call failing

**URL:** <https://www.ruby-forum.com/t/formoptionshelper-select-call-failing/47934>\
**Category:** Rails\
**Created:** [November 15, 2005, 7:15am UTC](https://www.ruby-forum.com/t/formoptionshelper-select-call-failing/47934 "2005-11-15T07:15:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [November 15, 2005, 7:15am UTC](https://www.ruby-forum.com/t/formoptionshelper-select-call-failing/47934/1 "2005-11-15T07:15:40Z")

</div>

In Rails 0.14.3, I’m doing the following in a view:

```
 <%= select 'folder', 'format', ['a', 'b', 'c'] %>

```

This line in is failing with:

```
 ActionView::TemplateError (too few arguments.)

```

Am I calling select incorrectly? (Yes, the @folder object does exist,  
and does have an attribute named ‘format’.) My reading of the  
options\_for\_select documentation says this should work. Am I missing  
something, or should I file a bug?

Replacing [‘a’, ‘b’, ‘c’] with [[‘a’, ‘a’], [‘b’, ‘b’], [‘c’, ‘c’]]  
generates the same error.

The stack trace looks like this:

```
 /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/

```

action\_view/helpers/form\_helper.rb:247:in `format' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/ action_view/helpers/form_helper.rb:247:in`send’  
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/  
action\_view/helpers/form\_helper.rb:247:in `value' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/ action_view/helpers/form_options_helper.rb:299:in`to\_select\_tag’  
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/  
action\_view/helpers/form\_options\_helper.rb:63:in `select’  
#{RAILS\_ROOT}/app/views/folder/new.rhtml:13

Cheers,

Pete Y.

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [November 16, 2005, 1:35am UTC](https://www.ruby-forum.com/t/formoptionshelper-select-call-failing/47934/2 "2005-11-16T01:35:56Z")

</div>

Hmmm, alright, I’ll break it out and see if I can make a simple app  
that demonstrates the bug. Thanks.

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [November 15, 2005, 4:24pm UTC](https://www.ruby-forum.com/t/formoptionshelper-select-call-failing/47934/3 "2005-11-15T16:24:00Z")

</div>

Pete Y. \<pete@…\> writes:

> and does have an attribute named ‘format’.) My reading of the  
> options\_for\_select documentation says this should work. Am I missing  
> something, or should I file a bug?
> 
> Replacing [‘a’, ‘b’, ‘c’] with [[‘a’, ‘a’], [‘b’, ‘b’], [‘c’, ‘c’]]  
> generates the same error.

> Cheers,
> 
> Pete Y.

I copied your tag to one of my views, changed the object and attribute  
names,  
and yes, it works.

I’m using Rails v 0.14.2.

I’m afraid I don’t know enough about Rails to say what the problem might  
be,  
but I don’t think it is the select tag.

regards

Steve
