# Changing path\_prefix and layout

**URL:** <https://www.ruby-forum.com/t/changing-path-prefix-and-layout/132176>\
**Category:** Rails\
**Created:** [March 17, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/changing-path-prefix-and-layout/132176 "2008-03-17T17:50:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![railsirrigation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/edb3f5/32.png) [@railsirrigation](https://www.ruby-forum.com/u/railsirrigation)\
**Post date:** [March 17, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/changing-path-prefix-and-layout/132176/1 "2008-03-17T17:50:45Z")

</div>

Im a newbie with rails and could use some guidance.

This is what I am doing. I have 3 distinct sections of a client  
site. Each having products, troubleshooting and a downloads. I want  
to use the same controllers for each section but have a  
different :path\_prefix and layout for each section. example:  
[http://www.mysite.com/section1/products](http://www.mysite.com/section1/products) &  
[http://www.mysite.com/section2/products](http://www.mysite.com/section2/products)  
would really goto the same controllers and db table but show different  
paths as above and have different layouts.

I see the routes has the :path\_prefix and searched some with not luck  
on finding how to do what I want.

any help is much appreciated.

Thanks  
Kevin

---

<div class="post-metadata">

**Author:** ![railsirrigation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/edb3f5/32.png) [@railsirrigation](https://www.ruby-forum.com/u/railsirrigation)\
**Post date:** [March 17, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/changing-path-prefix-and-layout/132176/2 "2008-03-17T19:50:11Z")

</div>

map.resources :products, :path\_prefix =\> ‘/:section\_name’
