# Undefined method \`to\_url' for "This is my weblog":String

**URL:** <https://www.ruby-forum.com/t/undefined-method-to-url-for-this-is-my-weblog-string/58721>\
**Category:** Rails\
**Created:** [April 25, 2006, 9:41am UTC](https://www.ruby-forum.com/t/undefined-method-to-url-for-this-is-my-weblog-string/58721 "2006-04-25T09:41:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pras](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@Pras](https://www.ruby-forum.com/u/Pras)\
**Post date:** [April 25, 2006, 9:41am UTC](https://www.ruby-forum.com/t/undefined-method-to-url-for-this-is-my-weblog-string/58721/1 "2006-04-25T09:41:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pras](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@Pras](https://www.ruby-forum.com/u/Pras)\
**Post date:** [April 27, 2006, 3:00am UTC](https://www.ruby-forum.com/t/undefined-method-to-url-for-this-is-my-weblog-string/58721/2 "2006-04-27T03:00:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Pras](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@Pras](https://www.ruby-forum.com/u/Pras)\
**Post date:** [April 27, 2006, 3:19am UTC](https://www.ruby-forum.com/t/undefined-method-to-url-for-this-is-my-weblog-string/58721/3 "2006-04-27T03:19:58Z")

</div>

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
