How do I test actionview helpers in the console?


#1

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.


#2
  • 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 MUPRN: 988
| at times when the
random email haiku | search indexer isn’t running
| (which was my first guess).


#3

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

(hint - click ‘show source’)

hey…I’m starting to learn these things

Craig