PDA

View Full Version : Scaffold Question (probably stupid)


Lord Bodak
March 29th, 2006, 01:48 PM
I messed with Rails a bit when it was less mature, and I'm trying to get a simple app going now.

What I've created (with migrations, _that_ was pretty neat) is a table named maximo_databases.

Then, with "script/generate scaffold MaximoDatabase" I created a scaffold for it.

Now, if I go to http://localhost:3000/MaximoDatabases I get:
NameError in Maximo_databases#index

uninitialized constant MaximoDatabasis

RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace

c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:112:in `const_missing'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:120:in `const_missing'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/inflector.rb:161:in `module_eval'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/inflector.rb:161:in `module_eval'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/inflector.rb:161:in `constantize'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/core_ext/string/inflections.rb:59:in `constantize'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/pagination.rb:194:in `paginator_and_collection_for'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/pagination.rb:129:in `paginate'
#{RAILS_ROOT}/app/controllers/maximo_databases_controller.rb:12:in `list'
#{RAILS_ROOT}/app/controllers/maximo_databases_controller.rb:3:in `index'

c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:112:in `const_missing'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:120:in `const_missing'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/inflector.rb:161:in `module_eval'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/inflector.rb:161:in `module_eval'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/inflector.rb:161:in `constantize'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/core_ext/string/inflections.rb:59:in `constantize'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/pagination.rb:194:in `paginator_and_collection_for'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/pagination.rb:129:in `paginate'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:908:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:908:in `perform_action_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:355:in `perform_action_without_benchmark'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in `measure'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/rescue.rb:82:in `perform_action'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:379:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:379:in `process_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:364:in `process_without_session_management_support'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session_management.rb:117:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/dispatcher.rb:38:in `dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:115:in `handle_dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:81:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:67:in `dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/commands/servers/webrick.rb:59
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:136:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/commands/server.rb:30
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:136:in `require'
script/server:3

c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:112:in `const_missing'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:120:in `const_missing'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/inflector.rb:161:in `module_eval'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/inflector.rb:161:in `module_eval'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/inflector.rb:161:in `constantize'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/core_ext/string/inflections.rb:59:in `constantize'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/pagination.rb:194:in `paginator_and_collection_for'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/pagination.rb:129:in `paginate'
#{RAILS_ROOT}/app/controllers/maximo_databases_controller.rb:12:in `list'
#{RAILS_ROOT}/app/controllers/maximo_databases_controller.rb:3:in `index'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:908:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:908:in `perform_action_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:355:in `perform_action_without_benchmark'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in `measure'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/rescue.rb:82:in `perform_action'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:379:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:379:in `process_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:364:in `process_without_session_management_support'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session_management.rb:117:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/dispatcher.rb:38:in `dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:115:in `handle_dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:81:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:67:in `dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/commands/servers/webrick.rb:59
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:136:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/commands/server.rb:30
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:136:in `require'
script/server:3

This error occured while loading the following files:
maximo_databasis.rb

Now, what's odd is, if I go to http://localhost:3000/MaximoDatabases/new the form comes up, and I can add a record, but when it redirects back to list I get the same error.

Any help would be greatly appreciated-- I'm sure it's something stupid I've done but I just don't know what it might be.

motobass
March 29th, 2006, 10:32 PM
I was looking at the last line. Shouldn't 'maximo_databasis.rb' be 'maximo_databases.rb'?

Lord Bodak
March 29th, 2006, 11:09 PM
I was looking at the last line. Shouldn't 'maximo_databasis.rb' be 'maximo_databases.rb'?

Bingo. It _should_ be but it's not. Turns out there is a pluralization (singularization? lol) bug. See http://dev.rubyonrails.org/ticket/3387.

I put something in my environment.rb to correct it and now it's working.