# Nested restful route param automagically populated on current page?

**URL:** <https://www.ruby-forum.com/t/nested-restful-route-param-automagically-populated-on-current-page/121767>\
**Category:** Rails\
**Created:** [November 30, 2007, 6:51pm UTC](https://www.ruby-forum.com/t/nested-restful-route-param-automagically-populated-on-current-page/121767 "2007-11-30T18:51:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blinking\_bear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Post date:** [November 30, 2007, 6:51pm UTC](https://www.ruby-forum.com/t/nested-restful-route-param-automagically-populated-on-current-page/121767/1 "2007-11-30T18:51:37Z")

</div>

I’ve been trying to figure out why this works…  
link\_to “foo”, admin\_comments\_url()

comments are a nested route of blogs, so it seems like that method would  
need the the blog param:

admin\_comments\_url(@blog)

However, when I’m already on this page /admin/blogs/1/comments, I don’t  
need  
to pass in the @blog param. Is this something that just happens  
magically  
behind the scenes?
