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
No forms for the page to fill the columns in the db. The generated page
is:
Employees: new
New employee
Back
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