# Nested resources and \_path methods

**URL:** <https://www.ruby-forum.com/t/nested-resources-and-path-methods/115857>\
**Category:** Rails\
**Created:** [September 29, 2007, 10:52am UTC](https://www.ruby-forum.com/t/nested-resources-and-path-methods/115857 "2007-09-29T10:52:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonas\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dfb087/32.png) [@jonas\_s](https://www.ruby-forum.com/u/jonas_s)\
**Post date:** [September 29, 2007, 10:52am UTC](https://www.ruby-forum.com/t/nested-resources-and-path-methods/115857/1 "2007-09-29T10:52:30Z")

</div>

Hi guys,

I was thinking aboiut this for a while:

If I have nested resource routes, for example /building/1/floor/2/room/  
3 (building has\_many floors and so on), I have to call the room\_path  
method like this:

room\_path @room.floor.building, @room.floor, @room

Isn´t there a better way to handle nested routes with foreign keys, or  
can I have this method overwritten somewhere?

Greets  
Jonas
