Hi Richard, RichardOnRails wrote:
> Referencing the URL http://localhost:3000/cvs netted me the > response: > “uninitialized constant CvsController::Cvs” > with the trace information: >app/controllers/cvs_controller.rb:5:in `index' > > Lines 4-5 of the controller are: > def index > @cvs = Cvs.find(:all) > > The cause seems clearly related to item 3 below. What should > I do to correct the situation. Change Cvs.find(:all) to Cv.find(:all) And yes, using a model name ending in 's' violates what it arguably Rails' most fundamental convention (by way of Active Record's fundamental role in Rails). Model names are singular versions of table names (so change app/models/cv.rb back if you haven't already). The fix above is the easiest open to you and will have you swimming with the stream. If you really want to go a different way, it's configurable. Start with the pluralization rules (Google is your friend). HTH, Bill By way of background. 1. I created a Rails 2.0.2 Payroll application a few days ago. 2. I more recently upgraded Rails to 2.2, which required a couple tweaks: a. The statement I used was: a. Removed the “config.action_view.cache_template_extensions” reference b. Set RAILS_GEM_VERSION = '2.2.0' 3. Created new model, Cvs ... where there was one anomaly: a. The statement I used was: ruby script/generate scaffold Cvs filename:string created:date modified:date imported:date b. The scaffold reported “create app/models/cv.rb” instead of cvs.rb c. I tried changing the name manually, but that only introduced more error msgs 4. “raked” the migrations 5. Validated the table creation by running SQLite3 6. Ran into the problem reported at the beginning of this post. What are my options for extricating myself from this situation? Thanks in advance, Richard --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

