# Routing issue

**URL:** <https://www.ruby-forum.com/t/routing-issue/172697>\
**Category:** Rails\
**Created:** [July 25, 2009, 11:49pm UTC](https://www.ruby-forum.com/t/routing-issue/172697 "2009-07-25T23:49:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [July 25, 2009, 11:49pm UTC](https://www.ruby-forum.com/t/routing-issue/172697/1 "2009-07-25T23:49:32Z")

</div>

Hi all

I’m having finding it difficult finding the proper way to route some  
pages in my application. The application follows the rest architecture  
and is closed for non authorized persons.

But their are some publicly available pages (normal content pages).  
These content pages are build dynamically. All the content comes from  
the database as the page structure. You could compare it to a basic cms.

So viewing the page list, editing / creating and deleting gets done by  
normal REST principles

edit\_pages\_path() =\> /en/pages/:id/edit  
new\_page\_path() =\> /en/pages/new

and are only accessible for the authorized people.

But the show action is where the content of the page is shown and is  
viewable by everyone. The only difference is, that the URL should look  
like this:

/en/page-title

So the controller name should not be visible for the viewers. Using the  
page title isn’t such a big deal. Instead of using page\_path(object), I  
put page\_path(:id =\> object.title) . The only downside is that the URL  
that gets rendered is /en/pages/page-title . So the controller name is  
visible.

I have tryed using the :as option in the route, but that just results in  
double slashes en even not being able to use the controller name for the  
other actions.

map.resources :pages, :as =\> “” , :path\_prefix =\> ‘/:locale’,

I know this should be possible, since other rails cms are able the  
achieve this. Or maybe its not because the application is restful. I  
hope their is someone here who could help me out and point me in the  
right direction.

Thank you in advance
