# How do I test actionview helpers in the console?

**URL:** <https://www.ruby-forum.com/t/how-do-i-test-actionview-helpers-in-the-console/53583>\
**Category:** Rails\
**Created:** [February 10, 2006, 2:50pm UTC](https://www.ruby-forum.com/t/how-do-i-test-actionview-helpers-in-the-console/53583 "2006-02-10T14:50:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eterps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecd19e/32.png) [@eterps](https://www.ruby-forum.com/u/eterps)\
**Post date:** [February 10, 2006, 2:50pm UTC](https://www.ruby-forum.com/t/how-do-i-test-actionview-helpers-in-the-console/53583/1 "2006-02-10T14:50:55Z")

</div>

I would like to see the output of actionview helper methods, to be able  
to play with it.

When I do the following in the console:

collection\_select(“job”, “client\_id” , @clients, “id”, “name”)

I get:

NoMethodError: undefined method `collection\_select’ for  
#Object:0xb7cf1970

I’d like to get something like:

 Francisco Hernandez James E.

Is this possible?

TIA,

Erik.

---

<div class="post-metadata">

**Author:** ![eterps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecd19e/32.png) [@eterps](https://www.ruby-forum.com/u/eterps)\
**Post date:** [February 10, 2006, 3:00pm UTC](https://www.ruby-forum.com/t/how-do-i-test-actionview-helpers-in-the-console/53583/2 "2006-02-10T15:00:22Z")

</div>

- Erik T. (removed\_email\_address@domain.invalid) [060210 08:54]:

> Francisco Hernandez James E.
> 
> Is this possible?

To my knowledge (I had a recent question about testing helper that call  
ActionView helper methods) you have to do some includes to get things  
visible. IIRC:

include ActionView::Helpers::TagHelper  
include ActionView::Helpers::UrlHelper

Not sure if more are needed or not.

## Rick

[http://www.rickbradley.com](http://www.rickbradley.com) MUPRN: 988  
| at times when the  
random email haiku | search indexer isn’t running  
| (which was my first guess).

---

<div class="post-metadata">

**Author:** ![eterps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecd19e/32.png) [@eterps](https://www.ruby-forum.com/u/eterps)\
**Post date:** [February 10, 2006, 3:01pm UTC](https://www.ruby-forum.com/t/how-do-i-test-actionview-helpers-in-the-console/53583/3 "2006-02-10T15:01:41Z")

</div>

On Fri, 2006-02-10 at 13:18 +0100, Erik T. wrote:

> #Object:0xb7cf1970
> 
> I’d like to get something like:
> 
> Francisco Hernandez James E.
> 
> Is this possible?

* * *

[http://rails.rubyonrails.com/classes/ActionView/Helpers/FormOptionsHelper.html#M000352](http://rails.rubyonrails.com/classes/ActionView/Helpers/FormOptionsHelper.html#M000352)

(hint - click ‘show source’)

hey…I’m starting to learn these things

Craig
