# Newbie Problem : Scaffold does not generate html form input fields

**URL:** <https://www.ruby-forum.com/t/newbie-problem-scaffold-does-not-generate-html-form-input-fields/139872>\
**Category:** Rails\
**Created:** [June 8, 2008, 4:05pm UTC](https://www.ruby-forum.com/t/newbie-problem-scaffold-does-not-generate-html-form-input-fields/139872 "2008-06-08T16:05:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@anij](https://www.ruby-forum.com/u/anij)\
**Post date:** [June 8, 2008, 4:05pm UTC](https://www.ruby-forum.com/t/newbie-problem-scaffold-does-not-generate-html-form-input-fields/139872/1 "2008-06-08T16:05:31Z")

</div>

Hi Friends,

I am newbie to Ruby on Rails and trying to follow through my first  
tutorial on RoR. I am following the “Getting Started with Rails”  
manual on RoR.

When I type  
“$ ruby script\generate scaffold Post blog”

it gives me an error something to the effect that says invalid number  
of arguments.

So I do the following.  
“$ ruby script\generate scaffold Post”

That generates the scaffold code. This seems to work and generate all  
files. However, it does not generate any of the fields that are  
required for my model or views e.g.

app\model\post.rb has the following code  
class Post \< ActiveRecord::Base  
end

app\views\posts\new.html.erb has the following code

# New post

\<% form\_for(@post) do |f| %\>  
\<%= f.error\_messages %\>

\<%= f.submit "Create" %\>

\<% end %\>

\<%= link\_to ‘Back’, posts\_path %\>

I am using ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] and  
Rails 2.1.0

Any hints?

CAN SOMEONE GUIDE ME?

Anij

---

<div class="post-metadata">

**Author:** ![anij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@anij](https://www.ruby-forum.com/u/anij)\
**Post date:** [June 8, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/newbie-problem-scaffold-does-not-generate-html-form-input-fields/139872/2 "2008-06-08T16:17:18Z")

</div>

To generate some fields you need to tell the scaffold what fields you  
want and what type they are. So, for example, if you wanted to create  
a Post with a title and body you would do:

script/generate scaffold Post title:string body:text

If you just type in ‘script/generate scaffold’ you’ll get examples on  
how to use the scaffold generator.

best.  
mike

---

<div class="post-metadata">

**Author:** ![anij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@anij](https://www.ruby-forum.com/u/anij)\
**Post date:** [June 8, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/newbie-problem-scaffold-does-not-generate-html-form-input-fields/139872/3 "2008-06-08T19:44:55Z")

</div>

Thank you Mike,

It really helped!!!

I guess the “getting started” that I am referring to is for the older  
version because now I am stuck at “start\_form\_tag” and can’t seem to  
find that in RDoc.

I need to find the latest “getting started”. If you happen to know the  
location do ping back.

and thank you for your help once again.

Regards,  
anij

---

<div class="post-metadata">

**Author:** ![anij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@anij](https://www.ruby-forum.com/u/anij)\
**Post date:** [August 27, 2010, 4:38pm UTC](https://www.ruby-forum.com/t/newbie-problem-scaffold-does-not-generate-html-form-input-fields/139872/4 "2010-08-27T16:38:04Z")

</div>

Michael B. wrote:

> To generate some fields you need to tell the scaffold what fields you  
> want and what type they are. So, for example, if you wanted to create  
> a Post with a title and body you would do:
> 
> script/generate scaffold Post title:string body:text
> 
> If you just type in ‘script/generate scaffold’ you’ll get examples on  
> how to use the scaffold generator.
> 
> best.  
> mike

Thanks a lot, this really helped me, I couldn’t find why my “new” page  
was empty.

---

<div class="post-metadata">

**Author:** ![anij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@anij](https://www.ruby-forum.com/u/anij)\
**Post date:** [June 8, 2008, 8:46pm UTC](https://www.ruby-forum.com/t/newbie-problem-scaffold-does-not-generate-html-form-input-fields/139872/5 "2008-06-08T20:46:21Z")

</div>

Hi Friends,

Just in case anyone is following this post…

If you are newbie like me and trying to follow the “Getting Started”  
on [Create A Perfect Resume In 5 Minutes! | Online Resume Builder](http://www.railsdocumentation.org/book.html) then Be careful!!!  
because it is not yet updated for Rails 2.x. There are significant  
changes in the way things are done in Rails 2.x.

Start by reading this… (hard learned lesson after wasting a perfect  
rainy sunday)  
[http://wiki.rubyonrails.org/rails/pages/GettingStartedWithRails](http://wiki.rubyonrails.org/rails/pages/GettingStartedWithRails)

> **[【下载央数钱包app】LSDFi Summer 来袭，快速读懂 6 个值得关注的 LSDFi 项目-tp冷钱包下载](https://www.jonathansng.com/ruby-on-rails/ruby-on-rails-tutorial-now-with-more-202/)**
>
> 作者 | 黑米，白泽研究院LSDFi 总锁仓价值TVL）突破 3.8 亿美元，Pendle、Lybra 等项目的代币大幅上涨，LSD 和 LSDFi 的叙事再度走热。在以太坊 Shapella 升级之

Regards,  
anij
