# CMS action & "/cms" subfolder for each controller

**URL:** <https://www.ruby-forum.com/t/cms-action-cms-subfolder-for-each-controller/171550>\
**Category:** Rails\
**Created:** [July 5, 2009, 12:30am UTC](https://www.ruby-forum.com/t/cms-action-cms-subfolder-for-each-controller/171550 "2009-07-05T00:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 5, 2009, 12:30am UTC](https://www.ruby-forum.com/t/cms-action-cms-subfolder-for-each-controller/171550/1 "2009-07-05T00:30:00Z")

</div>

How do I do this? (And is this a good solution?)

I want to have a “/cms” for each controller so I can login as admin  
and edit them, instead of creating whole new controllers for the cms.

Default if you add a new action like, def cms… you have to do /  
controller/1/cms.

I’m thinking of creating the backend that all links up each controller  
through the “/cms”

How can I route this? and is this a good idea?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 6, 2009, 5:04pm UTC](https://www.ruby-forum.com/t/cms-action-cms-subfolder-for-each-controller/171550/2 "2009-07-06T17:04:52Z")

</div>

Anyone have any idea? I’ve tried things like,

map.connect ‘/articles/cms’, :controller =\> ‘articles’, :action =\>  
‘cms’

But I get, “Couldn’t find Article with ID=cms”
