# Select error

**URL:** <https://www.ruby-forum.com/t/select-error/71614>\
**Category:** Rails\
**Created:** [February 21, 2006, 10:42pm UTC](https://www.ruby-forum.com/t/select-error/71614 "2006-02-21T22:42:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BuntinS\_SethSKATE](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/77aa72/32.png) [@BuntinS\_SethSKATE](https://www.ruby-forum.com/u/BuntinS_SethSKATE)\
**Post date:** [February 21, 2006, 10:42pm UTC](https://www.ruby-forum.com/t/select-error/71614/1 "2006-02-21T22:42:29Z")

</div>

This code:

Type

\<%= select(:resource, :type, %w{ Web Data }, { :include\_blank =\> true  
}) %\>

Produces this error:

TypeError in Resources#new

Showing app/views/resources/\_form.rhtml where line #6 raised:

wrong argument type String (expected Module)

Extracted source (around line #6):

3: Resource General  
4:  
5:

Type  
  
6: \<%= select(:resource, :type, %w{ Web Data }, { :include\_blank  
=\> true }) %\>  
7:

  
8:  
9: 

Focus

I took it straight out of the Agile Web D. book (except the  
:include\_blank)

Seth B.

Web Resources Coordinator

Kentucky Academy of Technology Education

Murray State University

---

<div class="post-metadata">

**Author:** ![BuntinS\_SethSKATE](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/77aa72/32.png) [@BuntinS\_SethSKATE](https://www.ruby-forum.com/u/BuntinS_SethSKATE)\
**Post date:** [February 22, 2006, 4:57pm UTC](https://www.ruby-forum.com/t/select-error/71614/2 "2006-02-22T16:57:14Z")

</div>

Buntin, Seth - KATE wrote:

> This code:
> 
> Type
> 
> \<%= select(:resource, :type, %w{ Web Data }, { :include\_blank =\> true  
> }) %\>

You have missed out the options parameter.

select(object, method, choices, options = {}, html\_options = {})

select(“post”, “person\_id”, Person.find\_all.collect {|p| [ p.name, p.id  
] }, { :include\_blank =\> true })

---

<div class="post-metadata">

**Author:** ![BuntinS\_SethSKATE](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/77aa72/32.png) [@BuntinS\_SethSKATE](https://www.ruby-forum.com/u/BuntinS_SethSKATE)\
**Post date:** [October 10, 2006, 12:02am UTC](https://www.ruby-forum.com/t/select-error/71614/3 "2006-10-10T00:02:47Z")

</div>

Buntin, Seth - KATE wrote:

> This code:
> 
> Type
> 
> \<%= select(:resource, :type, %w{ Web Data }, { :include\_blank =\> true  
> }) %\>

i experienced the same error  
i changed :type into :status and then it works fine  
i think :type is not allowed in select

---

<div class="post-metadata">

**Author:** ![BuntinS\_SethSKATE](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/77aa72/32.png) [@BuntinS\_SethSKATE](https://www.ruby-forum.com/u/BuntinS_SethSKATE)\
**Post date:** [October 10, 2006, 2:13am UTC](https://www.ruby-forum.com/t/select-error/71614/4 "2006-10-10T02:13:14Z")

</div>

I belive “type” is a method that returns the class of an Object and  
its now deprecated.  
So you wont be able to use it within your ror app.

D.
