How to make auto_link work in script/console

I wanted to take auto_link method for a ride but in script/console I get
the
message that “undefined method ‘tag_options’”.

What do I need to include in order to run auto_link(“ruby on rails”) on
ruby
script/console?

-=-

On 7/12/07, Neeraj K. [email protected] wrote:

I wanted to take auto_link method for a ride but in script/console I get the
message that “undefined method ‘tag_options’”.

What do I need to include in order to run auto_link(“ruby on rails”) on ruby
script/console?

include ActionView::Helpers::TagHelper

or, use the little “helper” thingy, and you don’t have to worry about
including stuff:

helper.auto_link(“ruby on rails”)
=> “ruby on rails”

On Jul 12, 2007, at 10:21 AM, Bob S. wrote:

or, use the little “helper” thingy, and you don’t have to worry about
including stuff:

helper.auto_link(“ruby on rails”)
=> “ruby on rails”

Loading production environment.

helper.auto_link(“please visit http://agileconsultingllc.com for
more information”)
=> “please visit <a href="http://agileconsultingllc.com">http://
agileconsultingllc.com for more information”

Hey thanks! That’s a fantastic tip!

-Rob

Rob B. http://agileconsultingllc.com
[email protected]

Question is if I do just

pluralize(2,“person”) in script/console without using helper or
including
anything , it works by default. While auto_link(“www.rubyonrails.org”)
chokes with error. Why this discrepancy. Why pluralize method is
automatically loaded.

-=-

then it must be windows issue. I killed my script/console then started
another one and it still works.

exit

D:\dev\eii4>ruby script/console
Loading development environment.

pluralize(2,“person”)
=> “2 people”

On Jul 12, 2007, at 4:33 PM, Neeraj K. wrote:

script/console?
Loading production environment.
[email protected]

Question is if I do just

pluralize(2,“person”) in script/console without using helper or
including anything , it works by default. While auto_link
("www.rubyonrails.org ") chokes with error. Why this discrepancy.
Why pluralize method is automatically loaded.

-=-

Are you sure? It doesn’t work for me.

Loading development environment.

pluralize(2,‘person’)
NoMethodError: undefined method pluralize' for #<Object:0x349f4> from (irb):1 helper.pluralize(2,'person') => "2 people" pluralize(2,'person') NoMethodError: undefined method pluralize’ for #Object:0x349f4
from (irb):3

-Rob

Rob B. http://agileconsultingllc.com
[email protected]