DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-08  18:01 UTC
NameError in Controller#index
This is my first time trying to use rails.
I have done nothing beyond generating the scaffolding.
When I try to view any of the generic pages I get this: NameError in
<tablename>Controller#index
It happens for every table.  This is actually more consistent that the
behavior I was getting before.  Two of my pages worked just fine but
the others would give this error.  I tried wiping everything and
starting from scratch.  Now I get this error everywhere, as comforting
as that is.
It will also complain about an uninitialized constant <tablename>
Any help would be greatly appreciated.
 NameError in TechniciansController#index
uninitialized constant Technician
RAILS_ROOT: C:/rails_apps/AT/config/..
Application Trace | Framework Trace | Full Trace
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:266:in `load_missing_constant''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:452:in `const_missing''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:464:in `const_missing''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
inflector.rb:250:in `constantize''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
core_ext/string/inflections.rb:148:in `constantize''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
pagination.rb:195:in `paginator_and_collection_for''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
pagination.rb:130:in `paginate''
#{RAILS_ROOT}/app/controllers/technicians_controller.rb:12:in `list''
#{RAILS_ROOT}/app/controllers/technicians_controller.rb:3:in `index''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:266:in `load_missing_constant''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:452:in `const_missing''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:464:in `const_missing''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
inflector.rb:250:in `constantize''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
core_ext/string/inflections.rb:148:in `constantize''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
pagination.rb:195:in `paginator_and_collection_for''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
pagination.rb:130:in `paginate''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
base.rb:1095:in `send''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
base.rb:1095:in `perform_action_without_filters''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
filters.rb:632:in `call_filter''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
filters.rb:634:in `call_filter''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
filters.rb:619:in `perform_action_without_benchmark''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
benchmarking.rb:66:in `perform_action_without_rescue''
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
benchmarking.rb:66:in `perform_action_without_rescue''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
rescue.rb:83:in `perform_action''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
base.rb:430:in `send''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
base.rb:430:in `process_without_filters''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
filters.rb:624:in `process_without_session_management_support''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
session_management.rb:114:in `process''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
base.rb:330:in `process''
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:41:in
`dispatch''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
rails.rb:78:in `process''
c:/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
rails.rb:76:in `process''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
618:in `process_client''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
617:in `each''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
617:in `process_client''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `initialize''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `new''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
720:in `initialize''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
720:in `new''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
720:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
configurator.rb:271:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
configurator.rb:270:in `each''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
configurator.rb:270:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel_rails:
127:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
command.rb:211:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel_rails:
243
c:/ruby/bin/mongrel_rails:18:in `load''
c:/ruby/bin/mongrel_rails:18
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:266:in `load_missing_constant''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:452:in `const_missing''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
dependencies.rb:464:in `const_missing''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
inflector.rb:250:in `constantize''
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/
core_ext/string/inflections.rb:148:in `constantize''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
pagination.rb:195:in `paginator_and_collection_for''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
pagination.rb:130:in `paginate''
#{RAILS_ROOT}/app/controllers/technicians_controller.rb:12:in `list''
#{RAILS_ROOT}/app/controllers/technicians_controller.rb:3:in `index''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
base.rb:1095:in `send''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
base.rb:1095:in `perform_action_without_filters''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
filters.rb:632:in `call_filter''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
filters.rb:634:in `call_filter''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
filters.rb:619:in `perform_action_without_benchmark''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
benchmarking.rb:66:in `perform_action_without_rescue''
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
benchmarking.rb:66:in `perform_action_without_rescue''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
rescue.rb:83:in `perform_action''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
base.rb:430:in `send''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
base.rb:430:in `process_without_filters''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
filters.rb:624:in `process_without_session_management_support''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
session_management.rb:114:in `process''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/
base.rb:330:in `process''
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:41:in
`dispatch''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
rails.rb:78:in `process''
c:/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
rails.rb:76:in `process''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
618:in `process_client''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
617:in `each''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
617:in `process_client''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `initialize''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `new''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
720:in `initialize''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
720:in `new''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
720:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
configurator.rb:271:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
configurator.rb:270:in `each''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
configurator.rb:270:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel_rails:
127:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
command.rb:211:in `run''
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel_rails:
243
c:/ruby/bin/mongrel_rails:18:in `load''
c:/ruby/bin/mongrel_rails:18
Request
Parameters: None
Show session dump
---
flash: !map:ActionController::Flash::FlashHash {}
Response
Headers: {"cookie"=>[],
"Cache-Control"=>"no-cache"}
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
please specify the contents of /app/controllers, /app/models, the controller file in question and the url you are attempting to access it with (and any applicable routing information. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-08  18:16 UTC
Re: NameError in Controller#index
Unfortunately I''m stuck developing this in Windows.
\app\controllers
    application.rb
    computers_controller.rb
    computer_roles_controller.rb
    depts_controller.rb
    free_programs_controller.rb
    licensed_programs_controller.rb
    sites_controller.rb
    technicians_controller.rb
\app\models
    computers.rb
    computer_roles.rb
    depts.rb
    free_programs.rb
    licensed_programs.rb
    sites.rb
    technicians.rb
It happens with any and all of the controller files.  Here is the
depts_controller.rb file
class DeptsController < ApplicationController
  def index
    list
    render :action => ''list''
  end
  # GETs should be safe (see http://www.w3.org/2001/tag/doc/
whenToUseGet.html)
  verify :method => :post, :only => [ :destroy, :create, :update ],
         :redirect_to => { :action => :list }
  def list
    @depts_pages, @depts = paginate :depts, :per_page => 10
  end
  def show
    @depts = Depts.find(params[:id])
  end
  def new
    @depts = Depts.new
  end
  def create
    @depts = Depts.new(params[:depts])
    if @depts.save
      flash[:notice] = ''Depts was successfully created.''
      redirect_to :action => ''list''
    else
      render :action => ''new''
    end
  end
  def edit
    @depts = Depts.find(params[:id])
  end
  def update
    @depts = Depts.find(params[:id])
    if @depts.update_attributes(params[:depts])
      flash[:notice] = ''Depts was successfully updated.''
      redirect_to :action => ''show'', :id => @depts
    else
      render :action => ''edit''
    end
  end
  def destroy
    Depts.find(params[:id]).destroy
    redirect_to :action => ''list''
  end
end
The URL I''m accessing is localhost:3000/depts
On Feb 8, 11:06 am, Keynan Pratt
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> please specify the contents of
>
> /app/controllers,
> /app/models,
> the controller file in question
> and the url you are attempting to access it with
> (and any applicable routing information.
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Have you modified config/database.yml to match your database server settings and run migrations(rake db:migrate)? Sounds kind of like the errors you get when it can''t find the database tables that correspond with the models. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-08  18:41 UTC
Re: NameError in Controller#index
I''d modified database.yml but not run migrations. I''ll try it after I get back from lunch. On Feb 8, 11:31 am, "monki" <gee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Have you modified config/database.yml to match your database server > settings and run migrations(rake db:migrate)? > > Sounds kind of like the errors you get when it can''t find the database > tables that correspond with the models.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-08  19:57 UTC
Re: NameError in Controller#index
Still no luck. Same errors. This is the output I got from the rake db:migrate (in C:/rails_apps/AT) == CreateTechnicians: migrating ==============================================-- create_table(:technicians) NOTICE: CREATE TABLE will create implicit sequence "technicians_id_seq" for ser ial column "technicians.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "technicians_pkey " for table "technicians" -> 0.2650s == CreateTechnicians: migrated (0.2650s) ===================================== I tried for technicians and for others but no go. On Feb 8, 11:41 am, "DamnBig...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <DamnBig...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''d modified database.yml but not run migrations. I''ll try it after I > get back from lunch. > > On Feb 8, 11:31 am, "monki" <gee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Have you modified config/database.yml to match your database server > > settings and run migrations(rake db:migrate)? > > > Sounds kind of like the errors you get when it can''t find the database > > tables that correspond with the models.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-08  20:00 UTC
Re: NameError in Controller#index
This is the last line in my development.log file: Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/templates/rescues/layout.rhtml (500 Internal Error) On Feb 8, 12:57 pm, "DamnBig...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <DamnBig...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Still no luck. Same errors. This is the output I got from the rake > db:migrate > > (in C:/rails_apps/AT) > == CreateTechnicians: migrating > ==============================================> -- create_table(:technicians) > NOTICE: CREATE TABLE will create implicit sequence > "technicians_id_seq" for ser > ial column "technicians.id" > NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index > "technicians_pkey > " for table "technicians" > -> 0.2650s > == CreateTechnicians: migrated (0.2650s) > =====================================> > I tried for technicians and for others but no go. > > On Feb 8, 11:41 am, "DamnBig...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <DamnBig...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > I''d modified database.yml but not run migrations. I''ll try it after I > > get back from lunch. > > > On Feb 8, 11:31 am, "monki" <gee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Have you modified config/database.yml to match your database server > > > settings and run migrations(rake db:migrate)? > > > > Sounds kind of like the errors you get when it can''t find the database > > > tables that correspond with the models.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
alright, I think I found it.> \app\models > computers.rb > computer_roles.rb > depts.rb > free_programs.rb > licensed_programs.rb > sites.rb > technicians.rbuninitialized constant Technician Model names should be singular, controllers plural. The assumption is that if you are talking about the TechniciansController and Technicians table that the model representing it will be called Technician.>From your model directory it looks like all of the models are named asplurals. If you have already defined things in the models you''ll probably just want to rename the files, and then open then and rename them in the: def Technicians < ActiveRecord::Base line to be def Technician < ActiveRecord::Base Or you can use script/destroy to get rid of stuff and script/generate to create it back. Just note that when you are generating scaffolding you should pass the singular version: script/generate scaffold technician It will automatically create the pluralized migration and controller stuff. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-08  20:44 UTC
Re: NameError in Controller#index
Thanks!!! I love it when I''m my own problem. Thanks again, now I can proceed to break it in new ways. On Feb 8, 1:11 pm, "monki" <gee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> alright, I think I found it. > > > \app\models > > computers.rb > > computer_roles.rb > > depts.rb > > free_programs.rb > > licensed_programs.rb > > sites.rb > > technicians.rb > > uninitialized constant Technician > > Model names should be singular, controllers plural. > > The assumption is that if you are talking about the > TechniciansController and Technicians table that the model > representing it will be called Technician. > > >From your model directory it looks like all of the models are named as > > plurals. > > If you have already defined things in the models you''ll probably just > want to rename the files, and then open then and rename them in the: > def Technicians < ActiveRecord::Base > line to be > def Technician < ActiveRecord::Base > > Or you can use script/destroy to get rid of stuff and script/generate > to create it back. > > Just note that when you are generating scaffolding you should pass the > singular version: > script/generate scaffold technician > It will automatically create the pluralized migration and controller > stuff.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
That is definately an easy problem to miss, I still do it sometimes. Good luck. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---