Forum: Ruby on Rails undefined method `to_url' for "This is my weblog":String

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8c70506408fddb9740b4de7339055c77?d=identicon&s=25 Pras (Guest)
on 2006-04-25 09:41
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
C9c7a65848f13e2b1a226bbe43bc3672?d=identicon&s=25 Pete Yandell (pete)
on 2006-04-27 03:00
(Received via mailing list)
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?
D0cd6b10e01bacb976b3b815a9c660bc?d=identicon&s=25 Alex Wayne (Guest)
on 2006-04-27 03:19
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 topic is locked and can not be replied to.