# Where have the forms gone?

**URL:** <https://www.ruby-forum.com/t/where-have-the-forms-gone/129206>\
**Category:** Rails\
**Created:** [February 15, 2008, 1:45pm UTC](https://www.ruby-forum.com/t/where-have-the-forms-gone/129206 "2008-02-15T13:45:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [February 15, 2008, 1:45pm UTC](https://www.ruby-forum.com/t/where-have-the-forms-gone/129206/1 "2008-02-15T13:45:17Z")

</div>

Hi,

I recently installed:

- Aptana Studio 1.1.0.007007
- Rails 2.0.2
- Ruby 1.8.6

First thing I noticed was that now I needed SqlLite3. I changed the  
database.yml to keep it like before:

development:  
adapter: mysql  
database: company\_development  
username: root  
password:  
host: localhost

I created a project. To my surprise now the .rhtml are now html.erb  
And when creating a basic scaffold I can create new (lets say employees)  
but the web interface is not showing the forms to enter the values for  
the created entries.

What has gone mad? Maybe the sql thing?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [February 17, 2008, 6:49pm UTC](https://www.ruby-forum.com/t/where-have-the-forms-gone/129206/2 "2008-02-17T18:49:15Z")

</div>

Hi,

Apparently my question is too dummy. But I’m still confused…  
I’ve been working on a project all the time where by default MySql was  
used and when creating a scaffold it would create .rhtml files

Now I noticed that I expects Sqlite3 and makes html.erb files.  
Have I missed a big thing??

I want to keep using MySql, is changing the yml file enough?

Any info is appreciated.

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [February 18, 2008, 12:54pm UTC](https://www.ruby-forum.com/t/where-have-the-forms-gone/129206/3 "2008-02-18T12:54:48Z")

</div>

On 17 Feb 2008, at 17:49, comopasta Gr wrote:

> Hi,
> 
> Apparently my question is too dummy. But I’m still confused…  
> I’ve been working on a project all the time where by default MySql was  
> used and when creating a scaffold it would create .rhtml files

Scaffolding in rails has changed, and is no longer dynamic (off the  
top of my head i think there’s a plugin to have old style scaffolding  
if you really want it)

> Now I noticed that I expects Sqlite3 and makes html.erb files.  
> Have I missed a big thing??
> 
> I want to keep using MySql, is changing the yml file enough?

yes.

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [February 18, 2008, 4:18pm UTC](https://www.ruby-forum.com/t/where-have-the-forms-gone/129206/4 "2008-02-18T16:18:56Z")

</div>

On 18 Feb 2008, at 14:32, comopasta Gr wrote:

> Thanks Frederick.
> 
> Well I guess I’ll have to learn to live with it.  
> I still don’t understand what is the point. At least now when trying  
> to  
> create a basic rails app I have to do more work…
> 
> - Change back to MySql

rails -d mysql will create it with mysql setup

> - Scaffold is not creating the controller so I need to create the  
> controller manually
> - The created controller is empty and now I have to fill it myself.

that shouldn’t be happening - it’s just the forms that don’t get  
autoupdated. Are you doing something like

script/generate scaffold purchase order\_id:integer amount:decimal

or are you just doing script/generate controller (that does just  
generate an empty controller)

Fred

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [February 18, 2008, 3:32pm UTC](https://www.ruby-forum.com/t/where-have-the-forms-gone/129206/5 "2008-02-18T15:32:31Z")

</div>

Thanks Frederick.

Well I guess I’ll have to learn to live with it.  
I still don’t understand what is the point. At least now when trying to  
create a basic rails app I have to do more work…

- Change back to MySql
- Scaffold is not creating the controller so I need to create the  
controller manually
- The created controller is empty and now I have to fill it myself.

I guess I’m doing something wrong or in the wrong order, otherwise I  
don’t understand that change.

Thanks.

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [February 19, 2008, 10:17am UTC](https://www.ruby-forum.com/t/where-have-the-forms-gone/129206/6 "2008-02-19T10:17:29Z")

</div>

> conclussion (?). I should do like in the first process. But then I  
> should add the db columns in the scaffold generation as you mentioned.

This created all the basic stuff.  
Any info when the dicussed changes where introduced? I wonder what else  
I’ve been missing. I guess I find out soon when I start porting my old  
application.

Cheers.

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [February 18, 2008, 10:45pm UTC](https://www.ruby-forum.com/t/where-have-the-forms-gone/129206/7 "2008-02-18T22:45:17Z")

</div>

> rails -d mysql will create it with mysql setup

Cool, I’ll start using that.

* * *

I started a project from scratch and go the next results:

1- Rails company

2- ruby script/generate scaffold Employee  
Yes I got pretty much everything. I think the order in which I did the  
process before affected the results. But now it seems ok. Contoller is  
created and contains the basic methods as expected

3- I edit the database.yml to change to MySql

4- I edit the db/migrate/001\_create\_employees.rb to fill in some data to  
the DB  
The MySql DB is filled accordingly. Just added three string columns.

5- Go to [http://127.0.0.1:3000/employees/new](http://127.0.0.1:3000/employees/new)  
No forms for the page to fill the columns in the db. The generated page  
is:

Employees: new

# New employee

[Back](https://www.ruby-forum.com/employees)

* * *

You are right. I’m not using generate scaffold purchase order\_id:integer  
amount:decimal. But if I recall correctly I’ve never done it in that way  
before and I always got the basic stuff created automatically.

* * *

Now. I repeated the process with a different order:

1- rails -d mysql empresa

2- ruby script/generate model Empleado  
This I didn’t do in the previous test.

3- rake db:migrate  
Fill the DB after adding some lines to the migrate file

4- ruby script/generate scaffold Empleado  
Well, this time running that didn’t generate the controller…so I  
decided to create it myself.

5- ruby script/generate controller Empleados  
And now it is created. But it is empty:

class EmpleadosController \< ApplicationController  
end

And the contents of the new.html.erb still didn’t have all the expected  
forms:

# New empleado
\<%= error\_messages\_for :empleado %\> \<% form\_for(@empleado) do |f| %\> 

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

\<% end %\> \<%= link\_to 'Back', empleados\_path %\>
* * *

conclussion (?). I should do like in the first process. But then I  
should add the db columns in the scaffold generation as you mentioned. I  
liked it better before, that’s still more work now isn’t it?

I am not an expert but I thought I had a basic understanding before.  
Apparently I don’t 😛

Again, thanks for your time Fred.

* * *

* * *

The next will make this post huge. But maybe I helps pasting the output  
of the commands for both procedures.

PROCEDURE ONE

C:\InstantRails\rails\_apps\>rails company  
create  
create app/controllers  
create app/helpers  
create app/models  
create app/views/layouts  
create config/environments  
create config/initializers  
create db  
create doc  
create lib  
create lib/tasks  
create log  
create public/images  
create public/javascripts  
create public/stylesheets  
create script/performance  
create script/process  
create test/fixtures  
create test/functional  
create test/integration  
create test/mocks/development  
create test/mocks/test  
create test/unit  
create vendor  
create vendor/plugins  
create tmp/sessions  
create tmp/sockets  
create tmp/cache  
create tmp/pids  
create Rakefile  
create README  
create app/controllers/application.rb  
create app/helpers/application\_helper.rb  
create test/test\_helper.rb  
create config/database.yml  
create config/routes.rb  
create public/.htaccess  
create config/initializers/inflections.rb  
create config/initializers/mime\_types.rb  
create config/boot.rb  
create config/environment.rb  
create config/environments/production.rb  
create config/environments/development.rb  
create config/environments/test.rb  
create script/about  
create script/console  
create script/destroy  
create script/generate  
create script/performance/benchmarker  
create script/performance/profiler  
create script/performance/request  
create script/process/reaper  
create script/process/spawner  
create script/process/inspector  
create script/runner  
create script/server  
create script/plugin  
create public/dispatch.rb  
create public/dispatch.cgi  
create public/dispatch.fcgi  
create public/404.html  
create public/422.html  
create public/500.html  
create public/index.html  
create public/favicon.ico  
create public/robots.txt  
create public/images/rails.png  
create public/javascripts/prototype.js  
create public/javascripts/effects.js  
create public/javascripts/dragdrop.js  
create public/javascripts/controls.js  
create public/javascripts/application.js  
create doc/README\_FOR\_APP  
create log/server.log  
create log/production.log  
create log/development.log  
create log/test.log

C:\InstantRails\rails\_apps\>cd company

C:\InstantRails\rails\_apps\company\>ruby script/generate scaffold  
Employee  
exists app/models/  
exists app/controllers/  
exists app/helpers/  
create app/views/employees  
exists app/views/layouts/  
exists test/functional/  
exists test/unit/  
create app/views/employees/index.html.erb  
create app/views/employees/show.html.erb  
create app/views/employees/new.html.erb  
create app/views/employees/edit.html.erb  
create app/views/layouts/employees.html.erb  
create public/stylesheets/scaffold.css  
dependency model  
exists app/models/  
exists test/unit/  
exists test/fixtures/  
create app/models/employee.rb  
create test/unit/employee\_test.rb  
create test/fixtures/employees.yml  
create db/migrate  
create db/migrate/001\_create\_employees.rb  
create app/controllers/employees\_controller.rb  
create test/functional/employees\_controller\_test.rb  
create app/helpers/employees\_helper.rb  
route map.resources :employees

# C:\InstantRails\rails\_apps\company\>rake db:migrate (in C:/InstantRails/rails\_apps/company) == 1 CreateEmployees: migrating

# – create\_table(:employees) → 0.1300s == 1 CreateEmployees: migrated (0.1300s)

PROCEDURE TWO

C:\InstantRails\rails\_apps\>rails -d mysql empresa  
create  
create app/controllers  
create app/helpers  
create app/models  
create app/views/layouts  
create config/environments  
create config/initializers  
create db  
create doc  
create lib  
create lib/tasks  
create log  
create public/images  
create public/javascripts  
create public/stylesheets  
create script/performance  
create script/process  
create test/fixtures  
create test/functional  
create test/integration  
create test/mocks/development  
create test/mocks/test  
create test/unit  
create vendor  
create vendor/plugins  
create tmp/sessions  
create tmp/sockets  
create tmp/cache  
create tmp/pids  
create Rakefile  
create README  
create app/controllers/application.rb  
create app/helpers/application\_helper.rb  
create test/test\_helper.rb  
create config/database.yml  
create config/routes.rb  
create public/.htaccess  
create config/initializers/inflections.rb  
create config/initializers/mime\_types.rb  
create config/boot.rb  
create config/environment.rb  
create config/environments/production.rb  
create config/environments/development.rb  
create config/environments/test.rb  
create script/about  
create script/console  
create script/destroy  
create script/generate  
create script/performance/benchmarker  
create script/performance/profiler  
create script/performance/request  
create script/process/reaper  
create script/process/spawner  
create script/process/inspector  
create script/runner  
create script/server  
create script/plugin  
create public/dispatch.rb  
create public/dispatch.cgi  
create public/dispatch.fcgi  
create public/404.html  
create public/422.html  
create public/500.html  
create public/index.html  
create public/favicon.ico  
create public/robots.txt  
create public/images/rails.png  
create public/javascripts/prototype.js  
create public/javascripts/effects.js  
create public/javascripts/dragdrop.js  
create public/javascripts/controls.js  
create public/javascripts/application.js  
create doc/README\_FOR\_APP  
create log/server.log  
create log/production.log  
create log/development.log  
create log/test.log

C:\InstantRails\rails\_apps\>cd empresa

C:\InstantRails\rails\_apps\empresa\>ruby script/generate model Empleado  
exists app/models/  
exists test/unit/  
exists test/fixtures/  
create app/models/empleado.rb  
create test/unit/empleado\_test.rb  
create test/fixtures/empleados.yml  
create db/migrate  
create db/migrate/001\_create\_empleados.rb

# C:\InstantRails\rails\_apps\empresa\>rake db:migrate (in C:/InstantRails/rails\_apps/empresa) == 1 CreateEmpleados: migrating

# – create\_table(:empleados) → 0.1610s == 1 CreateEmpleados: migrated (0.1610s)

C:\InstantRails\rails\_apps\empresa\>ruby script/generate scaffold  
Empleado  
exists app/models/  
exists app/controllers/  
exists app/helpers/  
create app/views/empleados  
exists app/views/layouts/  
exists test/functional/  
exists test/unit/  
create app/views/empleados/index.html.erb  
create app/views/empleados/show.html.erb  
create app/views/empleados/new.html.erb  
create app/views/empleados/edit.html.erb  
create app/views/layouts/empleados.html.erb  
create public/stylesheets/scaffold.css  
dependency model  
exists app/models/  
exists test/unit/  
exists test/fixtures/  
identical app/models/empleado.rb  
identical test/unit/empleado\_test.rb  
identical test/fixtures/empleados.yml  
exists db/migrate  
Another migration is already named create\_empleados:  
db/migrate/001\_create\_empleados.rb

C:\InstantRails\rails\_apps\empresa\>ruby script/generate controller  
Empleados  
exists app/controllers/  
exists app/helpers/  
exists app/views/empleados  
exists test/functional/  
create app/controllers/empleados\_controller.rb  
create test/functional/empleados\_controller\_test.rb  
create app/helpers/empleados\_helper.rb

C:\InstantRails\rails\_apps\empresa\>

END

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [February 19, 2008, 5:19pm UTC](https://www.ruby-forum.com/t/where-have-the-forms-gone/129206/8 "2008-02-19T17:19:12Z")

</div>

I know that there are a few of these floating around, but our area  
Ruby Brigade posted a Rails 2 cheatsheet that might help:  
[http://upstaterb.org/2008/2/14/rails-2-0-cheat-sheet](http://upstaterb.org/2008/2/14/rails-2-0-cheat-sheet)

On Feb 15, 7:45 am, comopasta Gr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [February 19, 2008, 9:52pm UTC](https://www.ruby-forum.com/t/where-have-the-forms-gone/129206/9 "2008-02-19T21:52:48Z")

</div>

AndyV wrote:

> I know that there are a few of these floating around, but our area  
> Ruby Brigade posted a Rails 2 cheatsheet that might help:  
> [http://upstaterb.org/2008/2/14/rails-2-0-cheat-sheet](http://upstaterb.org/2008/2/14/rails-2-0-cheat-sheet)
> 
> On Feb 15, 7:45 am, comopasta Gr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Thanks Andy that is a great summary of changes.

Cheers!
