# Help using active scaffold

**URL:** <https://www.ruby-forum.com/t/help-using-active-scaffold/128236>\
**Category:** Rails\
**Created:** [February 6, 2008, 2:39am UTC](https://www.ruby-forum.com/t/help-using-active-scaffold/128236 "2008-02-06T02:39:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![agilehack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@agilehack](https://www.ruby-forum.com/u/agilehack)\
**Post date:** [February 6, 2008, 2:39am UTC](https://www.ruby-forum.com/t/help-using-active-scaffold/128236/1 "2008-02-06T02:39:32Z")

</div>

I am trying to build a simple search/show tool as a first iteration of  
a larger project. I only have one table right now and I would like to  
implement active scaffold from the start of this project. I have  
tried several times but I am having trouble with active scaffold. I  
have my one table, I can easily create my model and controller several  
ways but one of the 3 steps in implementing active scaffold is to  
modify the layout:

\<%= javascript\_include\_tag :defaults %\>  
\<%= active\_scaffold\_includes %\>

problem is, if I create a project, then create my model and then  
controller - I don’t have a layout, nor do I really know how to create  
one or what to put in it. I tried implementing scaffold first and  
that works in giving me a layout to work with but I cant convert it  
over to active scaffold plus that seems like the clunky way to do it.  
To me it should be

rails   
ruby script/generate model   
ruby script/generate controller   
**implement AS** \*\*

can anyone help with this layout issue (i am not real good on the view  
side of things i guess

thanks

---

<div class="post-metadata">

**Author:** ![agilehack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@agilehack](https://www.ruby-forum.com/u/agilehack)\
**Post date:** [February 6, 2008, 3:24am UTC](https://www.ruby-forum.com/t/help-using-active-scaffold/128236/2 "2008-02-06T03:24:06Z")

</div>

On Feb 6, 2008 12:38 PM, agilehack [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> \<%= javascript\_include\_tag :defaults %\>  
> \<%= active\_scaffold\_includes %\>  
> can anyone help with this layout issue (i am not real good on the view  
> side of things i guess

Active Scaffold needs the following:

In your application layout file - put the active\_scaffold\_includes like  
you did.  
In your controller put:

active\_scaffold :modal\_plurals

In your routes.rb file, put

map.resources :model\_name, :active\_scaffold =\> true

This should give you a pure scaffold web page.

Then go to activescaffold website, and look at customizing views.

Regards

Mikel

---

<div class="post-metadata">

**Author:** ![agilehack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@agilehack](https://www.ruby-forum.com/u/agilehack)\
**Post date:** [February 6, 2008, 3:44am UTC](https://www.ruby-forum.com/t/help-using-active-scaffold/128236/3 "2008-02-06T03:44:43Z")

</div>

thank you thank you

couple questions:

1. i don’t have a layouts file do I? that is my problem. I know I  
need to add those two lines to it but unless i scaffold or something I  
do not have a layouts file in my project period. Do i just create a  
blank layouts file and just have those two lines? if i simply create  
a model and controller off the one table I don’t have a layout I guess  
is my point and if i have to create one manually i don’t really know  
how - what do i put in it, what do i call it …etc

2. in the controller what does this  
mean …active\_scaffold :modal\_plurals ??? i thought it was  
active\_scaffold: (model being singular

3. in the routes.rb file I will do what you say but why did the active  
scaffold site not say anything about modifying this file?

thanks a ton!

---

<div class="post-metadata">

**Author:** ![agilehack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@agilehack](https://www.ruby-forum.com/u/agilehack)\
**Post date:** [February 7, 2008, 6:27pm UTC](https://www.ruby-forum.com/t/help-using-active-scaffold/128236/4 "2008-02-07T18:27:48Z")

</div>

I got it, thanks for the help
