[clug-progsig] Ruby
Shawn
sgrover at open2space.com
Fri Feb 2 00:18:01 PST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Anyone have experience with Ruby?
I'm diving into it with a test project, and have been reviewing
tutorials and other such articles. They all seem to be telling me
"about" what needs to be done, rather than "what" to do. Granted, I'm
not following the rules exactly either - I'm trying to apply what
they're indicating to my own data model/needs.
So, I have tweaked my data model to follow the naming conventions that
are indicated (table names are plural, all ID fields are called "id",
etc). I ran "rails myproject" to get my structure, and edited the
database.yml file to point to my database. Then I ran the
./script/generate scaffold Tables on a bunch of my tables. So far, so
good. No errors reported.
Next I started my server with ./script/server, and tried to request a
page at http://127.0.0.1:3000/contacts. this resulted in the following:
NameError in ContactsController#index
uninitialized constant Contact
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:267:in
`load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:453:in
`const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:465:in
`const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/inflector.rb:251:in
`constantize'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/core_ext/string/inflections.rb:148:in
`constantize'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/pagination.rb:195:in
`paginator_and_collection_for'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/pagination.rb:130:in
`paginate'
app/controllers/contacts_controller.rb:12:in `list'
app/controllers/contacts_controller.rb:3:in `index'
So, I think either I missed a step, or my rails environment is not set
up right. I've had partial success with some VERY basic tables I've set
up and was able to get those at least to the listing screen.
I've been struggling with this one for the past hour, so I'm calling it
a night. But, I thought maybe some folks here might know enough to help
out. I think I'm at that "hand holding" stage we all need when starting
a new language.
Thanks for any input.
Shawn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFwvO5Mia5XCIAQC8RAhUTAJ9Vv2725vZ/aX9w0q1VCQLlU5B+NQCbBUGH
OLPsXyVNKV6imag6gUUMojY=
=eSvv
-----END PGP SIGNATURE-----
More information about the clug-progsig
mailing list