# Was just going through the section15.6 of agile web developm

**URL:** <https://www.ruby-forum.com/t/was-just-going-through-the-section15-6-of-agile-web-developm/113806>\
**Category:** Rails\
**Created:** [September 5, 2007, 6:46am UTC](https://www.ruby-forum.com/t/was-just-going-through-the-section15-6-of-agile-web-developm/113806 "2007-09-05T06:46:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhonny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/919ad9/32.png) [@jhonny](https://www.ruby-forum.com/u/jhonny)\
**Post date:** [September 5, 2007, 6:46am UTC](https://www.ruby-forum.com/t/was-just-going-through-the-section15-6-of-agile-web-developm/113806/1 "2007-09-05T06:46:19Z")

</div>

Hi,

I was just going through the section15.6 of agile web development PDF  
but somehow couldn’t understand how actually the & parameter works .

Check 15.6 An Extension to Ruby Symbols from agile web development  
PDF .

15.6

groups = posts.group\_by {|post| post.author\_id}

# Rails has a shorthand notation for this. We could have written this

code as

groups = posts.group\_by(&:author\_id)

they say that & uses a proc function given below ,but the function is  
even more confusing. .

class Symbol

def to\_proc

```
  Proc.new { |obj, *args| obj.send(self, *args) }

```

end

end

please do reply back if u have any solutions

Thank you

Regards,

Piyush G.

99161-33729

> **[Three finger salute](http://ctrlshiftesc.blogspot.com/)**
>
> I think, therefore I Am...said Descartes! 
> 
> I Am, therefore I will think...said Ayn Rand! 
> 
> I think I Am, therefore I think I am thinking...says The Common Man!!!
