# V.map(&:to\_s)

**URL:** <https://www.ruby-forum.com/t/v-map-to-s/138830>\
**Category:** Rails\
**Created:** [May 28, 2008, 5:15am UTC](https://www.ruby-forum.com/t/v-map-to-s/138830 "2008-05-28T05:15:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Archangel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a698b9/32.png) [@Eric\_Archangel](https://www.ruby-forum.com/u/Eric_Archangel)\
**Post date:** [May 28, 2008, 5:15am UTC](https://www.ruby-forum.com/t/v-map-to-s/138830/1 "2008-05-28T05:15:53Z")

</div>

How &: works? if it is a method, and where is it defined?  
It is rails addition to ruby obviously.

–  
Nibirutech CTO Eric.Archangel  
MSN: removed\_email\_address@domain.invalid  
QQ: 996252  
GMAIL: removed\_email\_address@domain.invalid  
BLOG: [http://blog.sina.com.cn/gameloft](http://blog.sina.com.cn/gameloft)

---

<div class="post-metadata">

**Author:** ![Eric\_Archangel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a698b9/32.png) [@Eric\_Archangel](https://www.ruby-forum.com/u/Eric_Archangel)\
**Post date:** [May 28, 2008, 5:27am UTC](https://www.ruby-forum.com/t/v-map-to-s/138830/2 "2008-05-28T05:27:44Z")

</div>

Eric Archangel wrote:

> How &: works? if it is a method, and where is it defined?  
> It is rails addition to ruby obviously.

[http://caboo.se/doc/classes/Symbol.html#M003931](http://caboo.se/doc/classes/Symbol.html#M003931)

Symbol#to\_proc

This is tricky thing to document. It exploits a ruby syntax quirk where  
prepending a & to a method argument calls “to\_proc” on that object in an  
attempt to make it eligible to be a block.

v.map(&:to\_s)

Is the same as:

v.map { |i| i.to\_s }
