I’ve got a Rails app that brings up a Home page, which includes a Vendor link. Clicking on that link I get ===========Web page start =======NameError in VendorController#index uninitialized constant VendorController RAILS_ROOT: K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS Application Trace | Framework Trace | Full Trace Request Parameters: None Show session dump Response Headers: {"Content-Type"=>"", "Cache-Control"=>"no-cache"} ===========Web page end =======I start up with http://localhost:3000, which references config \routes.rb that contains (sans comments): ActionController::Routing::Routes.draw do |map| map.resources :vendor map.root :controller => "home", :action => "index" map.connect '':controller/:action/:id'' map.connect '':controller/:action/:id.:format'' end That combination brings up a webpage that includes a link named Vendor, which is generated by the collective effect of: • app\controllers\ app\controllers class HomeController < ApplicationController layout ''standard'' def list end end • app\views\home\ index.html.erb <!-- \app\views\home\index.html.erb --> <%= link_to ''Vendor'', :controller=>''vendor'', :action=>''index'' %> My machine is configured with: Rails 2.3.5 Ruby 1.8.6 WinXP-Pro/SP3 Firefox 3.6 MySQL 5.0.37-community-nt Mongrel -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 3, 5:23 pm, RichardOnRails <RichardDummyMailbox58...-FtJgd9dCuO3JTKoYRCtP1UEOCMrvLtNR@public.gmane.org> wrote:> I’ve got a Rails app that brings up a Home page, which includes a > Vendor link. Clicking on that link I get > ===========Web page start =======> NameError in VendorController#index > uninitialized constant VendorControllerWhat''s in vendor_controller.rb ? Fred> RAILS_ROOT: K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS > Application Trace | Framework Trace | Full Trace > Request > Parameters: > None > Show session dump > Response > Headers: > {"Content-Type"=>"", > "Cache-Control"=>"no-cache"} > ===========Web page end =======> I start up withhttp://localhost:3000, which references config > \routes.rb that contains (sans comments): > ActionController::Routing::Routes.draw do |map| > map.resources :vendor > map.root :controller => "home", :action => "index" > map.connect '':controller/:action/:id'' > map.connect '':controller/:action/:id.:format'' > end > > That combination brings up a webpage that includes a link named > Vendor, which is generated by the collective effect of: > • app\controllers\ app\controllers > class HomeController < ApplicationController > layout ''standard'' > def list > end > end > • app\views\home\ index.html.erb > <!-- \app\views\home\index.html.erb --> > <%= link_to ''Vendor'', :controller=>''vendor'', :action=>''index'' %> > > > My machine is configured with: > Rails 2.3.5 > Ruby 1.8.6 > WinXP-Pro/SP3 > Firefox 3.6 > MySQL 5.0.37-community-nt > Mongrel-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I think it is looking for vendors_controller.rb The controller is always the plural of the model, unless specified. Renaming your vendor_controller.rb file to vendors_controller.rb should work. Punit RichardOnRails wrote:> I�ve got a Rails app that brings up a Home page, which includes a > Vendor link. Clicking on that link I get > ===========Web page start =======> NameError in VendorController#index > uninitialized constant VendorController > RAILS_ROOT: K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS > Application Trace | Framework Trace | Full Trace > Request > Parameters: > None > Show session dump-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Frederick, Thanks for looking into my problem. I trying hard to come up to speed on Rails. I think my Ruby''s now adequate. Best wishes, Richard> What''s in vendor_controller.rb ?\app\controllers\vendors_controller.rb ==========================class VendorsController < ApplicationController # GET /vendors # GET /vendors.xml def index @vendors = Vendor.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @vendors } end end # GET /vendors/1 # GET /vendors/1.xml def show @vendor = Vendor.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @vendor } end end # GET /vendors/new # GET /vendors/new.xml def new @vendor = Vendor.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @vendor } end end # GET /vendors/1/edit def edit @vendor = Vendor.find(params[:id]) end # POST /vendors # POST /vendors.xml def create @vendor = Vendor.new(params[:vendor]) respond_to do |format| if @vendor.save flash[:notice] = ''Vendor was successfully created.'' format.html { redirect_to(@vendor) } format.xml { render :xml => @vendor, :status => :created, :location => @vendor } else format.html { render :action => "new" } format.xml { render :xml => @vendor.errors, :status => :unprocessable_entity } end end end # PUT /vendors/1 # PUT /vendors/1.xml def update @vendor = Vendor.find(params[:id]) respond_to do |format| if @vendor.update_attributes(params[:vendor]) flash[:notice] = ''Vendor was successfully updated.'' format.html { redirect_to(@vendor) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @vendor.errors, :status => :unprocessable_entity } end end end # DELETE /vendors/1 # DELETE /vendors/1.xml def destroy @vendor = Vendor.find(params[:id]) @vendor.destroy respond_to do |format| format.html { redirect_to(vendors_url) } format.xml { head :ok } end end end On Mar 3, 1:10 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Mar 3, 5:23 pm, RichardOnRails > > <RichardDummyMailbox58...-FtJgd9dCuO3JTKoYRCtP1UEOCMrvLtNR@public.gmane.org> wrote: > > I’ve got a Rails app that brings up a Home page, which includes a > > Vendor link. Clicking on that link I get > > ===========Web page start =======> > NameError in VendorController#index > > uninitialized constant VendorController > > What''s in vendor_controller.rb ? > > Fred > > > RAILS_ROOT: K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS > > Application Trace | Framework Trace | Full Trace > > Request > > Parameters: > > None > > Show session dump > > Response > > Headers: > > {"Content-Type"=>"", > > "Cache-Control"=>"no-cache"} > > ===========Web page end =======> > I start up withhttp://localhost:3000, which references config > > \routes.rb that contains (sans comments): > > ActionController::Routing::Routes.draw do |map| > > map.resources :vendor > > map.root :controller => "home", :action => "index" > > map.connect '':controller/:action/:id'' > > map.connect '':controller/:action/:id.:format'' > > end > > > That combination brings up a webpage that includes a link named > > Vendor, which is generated by the collective effect of: > > • app\controllers\ app\controllers > > class HomeController < ApplicationController > > layout ''standard'' > > def list > > end > > end > > • app\views\home\ index.html.erb > > <!-- \app\views\home\index.html.erb --> > > <%= link_to ''Vendor'', :controller=>''vendor'', :action=>''index'' %> > > > > > My machine is configured with: > > Rails 2.3.5 > > Ruby 1.8.6 > > WinXP-Pro/SP3 > > Firefox 3.6 > > MySQL 5.0.37-community-nt > > Mongrel-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi All, I got the links working. I was just puttering around and all of a sudden I got them working. If I can figure out what''s different now compared to my failing version, I''ll report back. I''m not confident I''ll be able to tell because I just keep hacking until I get something working. II haven''t taken the time to get subversion, etc., working. Best wishes, Richard On Mar 3, 12:23 pm, RichardOnRails <RichardDummyMailbox58...-FtJgd9dCuO3JTKoYRCtP1UEOCMrvLtNR@public.gmane.org> wrote:> I’ve got a Rails app that brings up a Home page, which includes a > Vendor link. Clicking on that link I get > ===========Web page start =======> NameError in VendorController#index > uninitialized constant VendorController > RAILS_ROOT: K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS > Application Trace | Framework Trace | Full Trace > Request > Parameters: > None > Show session dump > Response > Headers: > {"Content-Type"=>"", > "Cache-Control"=>"no-cache"} > ===========Web page end =======> I start up withhttp://localhost:3000, which references config > \routes.rb that contains (sans comments): > ActionController::Routing::Routes.draw do |map| > map.resources :vendor > map.root :controller => "home", :action => "index" > map.connect '':controller/:action/:id'' > map.connect '':controller/:action/:id.:format'' > end > > That combination brings up a webpage that includes a link named > Vendor, which is generated by the collective effect of: > • app\controllers\ app\controllers > class HomeController < ApplicationController > layout ''standard'' > def list > end > end > • app\views\home\ index.html.erb > <!-- \app\views\home\index.html.erb --> > <%= link_to ''Vendor'', :controller=>''vendor'', :action=>''index'' %> > > > My machine is configured with: > Rails 2.3.5 > Ruby 1.8.6 > WinXP-Pro/SP3 > Firefox 3.6 > MySQL 5.0.37-community-nt > Mongrel-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 3 March 2010 21:26, RichardOnRails <RichardDummyMailbox58407-gP6xRNRnnqSxhq/XJNNIW0EOCMrvLtNR@public.gmane.org> wrote:> Hi All, > > I got the links working. I was just puttering around and all of a > sudden I got them working. If I can figure out what''s different now > compared to my failing version, I''ll report back. > > I''m not confident I''ll be able to tell because I just keep hacking > until I get something working. II haven''t taken the time to get > subversion, etc., working.Do it now, it will save time in the long run. It is difficult to learn if you are not sure what you did to fix something. Most seem to be using git now, it is my personal choice. It is trivially easy to start a repository even when just playing with a new idea. Colin> > Best wishes, > Richard > > On Mar 3, 12:23 pm, RichardOnRails > <RichardDummyMailbox58...-FtJgd9dCuO3JTKoYRCtP1UEOCMrvLtNR@public.gmane.org> wrote: >> I’ve got a Rails app that brings up a Home page, which includes a >> Vendor link. Clicking on that link I get >> ===========Web page start =======>> NameError in VendorController#index >> uninitialized constant VendorController >> RAILS_ROOT: K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS >> Application Trace | Framework Trace | Full Trace >> Request >> Parameters: >> None >> Show session dump >> Response >> Headers: >> {"Content-Type"=>"", >> "Cache-Control"=>"no-cache"} >> ===========Web page end =======>> I start up withhttp://localhost:3000, which references config >> \routes.rb that contains (sans comments): >> ActionController::Routing::Routes.draw do |map| >> map.resources :vendor >> map.root :controller => "home", :action => "index" >> map.connect '':controller/:action/:id'' >> map.connect '':controller/:action/:id.:format'' >> end >> >> That combination brings up a webpage that includes a link named >> Vendor, which is generated by the collective effect of: >> • app\controllers\ app\controllers >> class HomeController < ApplicationController >> layout ''standard'' >> def list >> end >> end >> • app\views\home\ index.html.erb >> <!-- \app\views\home\index.html.erb --> >> <%= link_to ''Vendor'', :controller=>''vendor'', :action=>''index'' %> >> >> >> My machine is configured with: >> Rails 2.3.5 >> Ruby 1.8.6 >> WinXP-Pro/SP3 >> Firefox 3.6 >> MySQL 5.0.37-community-nt >> Mongrel > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Colin, Thanks for the encouragement. I swear I''ll start employing subversion after I meet my two-week deadline on the first phase of the project I''m on. Best wishes, Richard On Mar 3, 4:56 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 3 March 2010 21:26, RichardOnRails > > <RichardDummyMailbox58...-gP6xRNRnnqSxhq/XJNNIW0EOCMrvLtNR@public.gmane.org> wrote: > > Hi All, > > > I got the links working. I was just puttering around and all of a > > sudden I got them working. If I can figure out what''s different now > > compared to my failing version, I''ll report back. > > > I''m not confident I''ll be able to tell because I just keep hacking > > until I get something working. II haven''t taken the time to get > > subversion, etc., working. > > Do it now, it will save time in the long run. It is difficult to > learn if you are not sure what you did to fix something. Most seem to > be using git now, it is my personal choice. It is trivially easy to > start a repository even when just playing with a new idea. > > Colin > > > > > Best wishes, > > Richard > > > On Mar 3, 12:23 pm, RichardOnRails > > <RichardDummyMailbox58...-FtJgd9dCuO3JTKoYRCtP1UEOCMrvLtNR@public.gmane.org> wrote: > >> I’ve got a Rails app that brings up a Home page, which includes a > >> Vendor link. Clicking on that link I get > >> ===========Web page start =======> >> NameError in VendorController#index > >> uninitialized constant VendorController > >> RAILS_ROOT: K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS > >> Application Trace | Framework Trace | Full Trace > >> Request > >> Parameters: > >> None > >> Show session dump > >> Response > >> Headers: > >> {"Content-Type"=>"", > >> "Cache-Control"=>"no-cache"} > >> ===========Web page end =======> >> I start up withhttp://localhost:3000, which references config > >> \routes.rb that contains (sans comments): > >> ActionController::Routing::Routes.draw do |map| > >> map.resources :vendor > >> map.root :controller => "home", :action => "index" > >> map.connect '':controller/:action/:id'' > >> map.connect '':controller/:action/:id.:format'' > >> end > > >> That combination brings up a webpage that includes a link named > >> Vendor, which is generated by the collective effect of: > >> • app\controllers\ app\controllers > >> class HomeController < ApplicationController > >> layout ''standard'' > >> def list > >> end > >> end > >> • app\views\home\ index.html.erb > >> <!-- \app\views\home\index.html.erb --> > >> <%= link_to ''Vendor'', :controller=>''vendor'', :action=>''index'' %> > >> > > >> My machine is configured with: > >> Rails 2.3.5 > >> Ruby 1.8.6 > >> WinXP-Pro/SP3 > >> Firefox 3.6 > >> MySQL 5.0.37-community-nt > >> Mongrel > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
RichardOnRails wrote:> Hi Colin, > > Thanks for the encouragement. I swear I''ll start employing subversion > after I meet my two-week deadline on the first phase of the project > I''m on. > > Best wishes, > RichardYou''re kidding, right? Git in particular is very quick to set up. Do it *now* and you''ll be better able to meet your deadline. There is no excuse at all for not using version control at all times. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.