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

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

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?

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs