# Script/generate scaffold Products Admin----not running

**URL:** <https://www.ruby-forum.com/t/script-generate-scaffold-products-admin-not-running/141649>\
**Category:** Rails\
**Created:** [June 28, 2008, 9:11am UTC](https://www.ruby-forum.com/t/script-generate-scaffold-products-admin-not-running/141649 "2008-06-28T09:11:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![suri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@suri](https://www.ruby-forum.com/u/suri)\
**Post date:** [June 28, 2008, 9:11am UTC](https://www.ruby-forum.com/t/script-generate-scaffold-products-admin-not-running/141649/1 "2008-06-28T09:11:42Z")

</div>

hi,  
i have installed  
ruby 1.8.6 window version,  
rails 2.1.0

everything runs fine except SCAFFOLD  
when i run  
ruby script/generate scaffold modelname controllername actions  
e,g. C:depot\>ruby script/generate scaffold Product Admin  
it gives following error  
“WRONG NUMBER OF ARGUMENTS (1 FOR 2)”  
i tried with many dummyprojects and tutorial,  
BUT if i run  
ruby script/generate scaffold modelname  
e.g ruby script/generate scaffold Product  
IT’S RUN FINE  
SEE THE FOLLOWING

D:\svn\trunk\workspace\test\>ruby script/generate scaffold Product Admin  
exists app/models/  
exists app/controllers/  
exists app/helpers/  
create app/views/products  
exists app/views/layouts/  
exists test/functional/  
exists test/unit/  
exists public/stylesheets/  
create app/views/products/index.html.erb  
wrong number of arguments (1 for 2)

D:\svn\trunk\workspace\test\>ruby script/generate scaffold Product  
exists app/models/  
exists app/controllers/  
exists app/helpers/  
exists app/views/products  
exists app/views/layouts/  
exists test/functional/  
exists test/unit/  
exists public/stylesheets/  
overwrite app/views/products/index.html.erb? (enter “h” for help)  
[Ynaqdh] y  
force app/views/products/index.html.erb  
create app/views/products/show.html.erb  
create app/views/products/new.html.erb  
create app/views/products/edit.html.erb  
create app/views/layouts/products.html.erb  
create public/stylesheets/scaffold.css  
create app/controllers/products\_controller.rb  
create test/functional/products\_controller\_test.rb  
create app/helpers/products\_helper.rb  
route map.resources :products  
dependency model  
exists app/models/  
exists test/unit/  
exists test/fixtures/  
create app/models/product.rb  
create test/unit/product\_test.rb  
create test/fixtures/products.yml  
create db/migrate  
create db/migrate/20080628070012\_create\_products.rb

D:\svn\trunk\workspace\test\>

BUT RESULTS ARE A BIT DIFFERENT ,  
i am looking for Modelname “Product”, Controllername “Admin”  
and Actions “show.rhtml, new.rhml, edit.rhtml,\_form.rhtml”

BUT RESULTS ARE  
Modelname “Product” , Controllername “Products”,and Actions  
“show.html.erb,new.html.erb,edit.html.erb,index.html.erb”

PLZ HELP ME WHAT’S GOING WRONG  
thanks  
sanjay

---

<div class="post-metadata">

**Author:** ![suri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@suri](https://www.ruby-forum.com/u/suri)\
**Post date:** [June 28, 2008, 2:12pm UTC](https://www.ruby-forum.com/t/script-generate-scaffold-products-admin-not-running/141649/2 "2008-06-28T14:12:13Z")

</div>

On Jun 28, 2008, at 3:11 AM, Sanjay S. wrote:

> ```
> it gives following error
> exists app/models/
> 
> ```
> 
> D:\svn\trunk\workspace\test\>ruby script/generate scaffold Product  
> force app/views/products/index.html.erb  
> exists app/models/  
> BUT RESULTS ARE A BIT DIFFERENT ,  
> i am looking for Modelname “Product”, Controllername “Admin”  
> and Actions “show.rhtml, new.rhml, edit.rhtml,\_form.rhtml”

.rhtml is no longer rails conventions for view templates. The results  
below are correct.

> BUT RESULTS ARE  
> Modelname “Product” , Controllername “Products”,and Actions  
> “show.html.erb,new.html.erb,edit.html.erb,index.html.erb”
> 
> PLZ HELP ME WHAT’S GOING WRONG

you don’t need the “controllername actions” when using scaffold. a  
RESTful controller will be generated for you.

(from the help)

Usage: ./script/generate scaffold ModelName [field:type, field:type]

For example, `scaffold post title:string body:text published:boolean`

Type “ruby script/generate scaffold” for the full help.

Best.  
MIke

---

<div class="post-metadata">

**Author:** ![suri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@suri](https://www.ruby-forum.com/u/suri)\
**Post date:** [June 30, 2008, 8:13am UTC](https://www.ruby-forum.com/t/script-generate-scaffold-products-admin-not-running/141649/3 "2008-06-30T08:13:12Z")

</div>

thanks Michael B.  
now it’s clear to me,  
thanks for good help,

sanjay shankar

Michael B. wrote:

> On Jun 28, 2008, at 3:11 AM, Sanjay S. wrote:
> 
> > ```
> > it gives following error
> > exists app/models/
> > 
> > ```
> > 
> > D:\svn\trunk\workspace\test\>ruby script/generate scaffold Product  
> > force app/views/products/index.html.erb  
> > exists app/models/  
> > BUT RESULTS ARE A BIT DIFFERENT ,  
> > i am looking for Modelname “Product”, Controllername “Admin”  
> > and Actions “show.rhtml, new.rhml, edit.rhtml,\_form.rhtml”
> 
> .rhtml is no longer rails conventions for view templates. The results  
> below are correct.
> 
> > BUT RESULTS ARE  
> > Modelname “Product” , Controllername “Products”,and Actions  
> > “show.html.erb,new.html.erb,edit.html.erb,index.html.erb”
> > 
> > PLZ HELP ME WHAT’S GOING WRONG
> 
> you don’t need the “controllername actions” when using scaffold. a  
> RESTful controller will be generated for you.
> 
> (from the help)
> 
> Usage: ./script/generate scaffold ModelName [field:type, field:type]
> 
> For example, `scaffold post title:string body:text published:boolean`
> 
> Type “ruby script/generate scaffold” for the full help.
> 
> Best.  
> MIke
