# scaffolding with namespace

**URL:** <https://discuss.rubyonrails.org/t/scaffolding-with-namespace/28925>\
**Category:** rubyonrails-talk\
**Created:** [May 4, 2008, 3:28pm UTC](https://discuss.rubyonrails.org/t/scaffolding-with-namespace/28925 "2008-05-04T15:28:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Martin](https://discuss.rubyonrails.org/u/Martin)\
**Post date:** [May 4, 2008, 3:28pm UTC](https://discuss.rubyonrails.org/t/scaffolding-with-namespace/28925/1 "2008-05-04T15:28:12Z")

</div>

Hi,

is there a way to scaffold with namespace? I'd like to generate a Posts model with namespace admin. But using &nbsp;&nbsp;script/generate scaffold admin/post title:string the migration would generate a table "admin\_posts". So I did now &nbsp;&nbsp;script/generate scaffold post title:string moved the controller, views manually to admin/... and had to change each link manually from (e.g.) redirect\_to @post to redirect\_to(admin\_post\_path(@post))

I think there has to be a simpler way.

Tia, Martin

---

<div class="post-metadata">

**Author:** ![Phlip](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@Phlip](https://discuss.rubyonrails.org/u/Phlip)\
**Post date:** [May 4, 2008, 6:31pm UTC](https://discuss.rubyonrails.org/t/scaffolding-with-namespace/28925/2 "2008-05-04T18:31:10Z")

</div>

Martin wrote:

> is there a way to scaffold with namespace?

Don't lean on scaffolds too much. Rails coding is generally not about the scaffolds.

> So I did now script/generate scaffold post title:string moved the controller, views manually to admin/... and had to change each link manually from (e.g.) redirect\_to @post to redirect\_to(admin\_post\_path(@post))

A generator produced rubber-stamp code for you to upgrade. The rest is up to you.

Next, scaffolds are fun for people who understand databases, which means they might not be the best solution for your customers. They might need pages which lead them thru their workflow, regardless which models these cross.
