# How can I divide my Page into different Sections?

**URL:** <https://www.ruby-forum.com/t/how-can-i-divide-my-page-into-different-sections/164265>\
**Category:** Rails\
**Created:** [March 30, 2009, 5:50pm UTC](https://www.ruby-forum.com/t/how-can-i-divide-my-page-into-different-sections/164265 "2009-03-30T17:50:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pwesner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5e9695/32.png) [@pwesner](https://www.ruby-forum.com/u/pwesner)\
**Post date:** [March 30, 2009, 5:50pm UTC](https://www.ruby-forum.com/t/how-can-i-divide-my-page-into-different-sections/164265/1 "2009-03-30T17:50:02Z")

</div>

Hello,

I have the following Problem: On my site I’d like to have different  
sections like Community, Shop, etc to be accessed via domain.tld/  
Community/Controller/… Its all in the same app and I am using  
restful Routes and Controllers. Is there a clean way to handle that  
with restful routes?

I also want to be able to know in which Section the user is and i’d  
like to use some Controllers in different Sections.

Philipp

---

<div class="post-metadata">

**Author:** ![pwesner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5e9695/32.png) [@pwesner](https://www.ruby-forum.com/u/pwesner)\
**Post date:** [March 31, 2009, 5:33pm UTC](https://www.ruby-forum.com/t/how-can-i-divide-my-page-into-different-sections/164265/2 "2009-03-31T17:33:16Z")

</div>

Philipp,

Take a look at path\_prefix:  
[http://api.rubyonrails.org/classes/ActionController/Resources.html](http://api.rubyonrails.org/classes/ActionController/Resources.html)

That should do what you want. You could go about it other ways as  
well, but that’s probably the best approach.

Remember that “rake routes” is your best friend in this case… it  
lets you see all the path mappings based upon your routes.rb  
definitions.

The other way you could do this is to use namespaces. People do this  
often for admin sections. You could do this for your various sections.  
You have to be careful of naming conventions, though. Search here for  
“admin” and/or “namespace” as I know it’s been well discussed for  
quite some time.

-Danimal
