Undefined method `to_url' for "This is my weblog":String


#1

Hi,

In my application I cant use “to_url” method on any of strings. What
should I do if i want to use this method? Is there any plugin needed to
download for this “to_url”. In my application now when I am trying to
use this methos I am getting following error:-

undefined method `to_url’ for “This is my weblog”:String

PLease tell me.

Thanx in advance.

Prash


#2

The error message is right: String doesn’t have a to_url method.
Where did you read about this method, and what do you expect it to do?


#3

Pras wrote:

Hi,

In my application I cant use “to_url” method on any of strings. What
should I do if i want to use this method? Is there any plugin needed to
download for this “to_url”. In my application now when I am trying to
use this methos I am getting following error:-

undefined method `to_url’ for “This is my weblog”:String

PLease tell me.

Thanx in advance.

Prash

You can add one to String if you like

class String
def to_url
#Do some stuff to a string
end
end