Hi All, I''ve got a Rails app that I broke by adding some code from a book. To unravel this I tried to just get something working but only got an error message. I expected the following code to transfer control to the index method in the view and have it yield the text there with appropriate HTML glued around it. Is there a simple fix so I could just get something working? Thanks in advance, Richard config\routes.rb: ActionController::Routing::Routes.draw do |map| map.connect '''', :controller => "home", :action => "home" snip app\controllers\home_controller.rb: class HomeController < ApplicationController def index @title = "RTS: Receipts Tracking System" end end app\views\home\index.html.erb: <div> This is a Div section in Index.htms.erb in app\views\home </div> http://localhost:3000/ Unknown action No action responded to home. Actions: index -- 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.
On 1 March 2010 21:42, RichardOnRails <RichardDummyMailbox58407-gP6xRNRnnqSxhq/XJNNIW0EOCMrvLtNR@public.gmane.org> wrote:> Hi All, > > I''ve got a Rails app that I broke by adding some code from a book. To > unravel this I tried to just get something working but only got an > error message. I expected the following code to transfer control to > the index method in the view and have it yield the text there with > appropriate HTML glued around it. > > Is there a simple fix so I could just get something working? > > Thanks in advance, > Richard > > config\routes.rb: > ActionController::Routing::Routes.draw do |map| > map.connect '''', :controller => "home", :action => "home"That should be :action => "index" I think. Colin> > snip > > app\controllers\home_controller.rb: > class HomeController < ApplicationController > def index > @title = "RTS: Receipts Tracking System" > end > end > > app\views\home\index.html.erb: > <div> > This is a Div section in Index.htms.erb > in app\views\home > </div> > > http://localhost:3000/ > Unknown action > > No action responded to home. Actions: index-- 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 Mon, 2010-03-01 at 13:42 -0800, RichardOnRails wrote:> Hi All, > > I''ve got a Rails app that I broke by adding some code from a book. To > unravel this I tried to just get something working but only got an > error message. I expected the following code to transfer control to > the index method in the view and have it yield the text there with > appropriate HTML glued around it. > > Is there a simple fix so I could just get something working? > > Thanks in advance, > Richard > > config\routes.rb: > ActionController::Routing::Routes.draw do |map| > map.connect '''', :controller => "home", :action => "home" > > snip > > app\controllers\home_controller.rb: > class HomeController < ApplicationController > def index > @title = "RTS: Receipts Tracking System" > end > end > > app\views\home\index.html.erb: > <div> > This is a Div section in Index.htms.erb > in app\views\home > </div> > > http://localhost:3000/ > Unknown action > > No action responded to home. Actions: index---- I think you want to change... map.connect '''', :controller => "home", :action => "home" to map.connect '''', :controller => "home", :action => "index" restart the ''server'' (script/server) Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- 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.
Hi Colin and Craig, Thank you very much. Of course I meant "index" but had so many failures I was approaching brain-dead. Now I''m back on new errors I can deal with. Best wishes, Richard On Mar 1, 4:42 pm, RichardOnRails <RichardDummyMailbox58...-FtJgd9dCuO3JTKoYRCtP1UEOCMrvLtNR@public.gmane.org> wrote:> Hi All, > > I''ve got a Rails app that I broke by adding some code from a book. To > unravel this I tried to just get something working but only got an > error message. I expected the following code to transfer control to > the index method in the view and have it yield the text there with > appropriate HTML glued around it. > > Is there a simple fix so I could just get something working? > > Thanks in advance, > Richard > > config\routes.rb: > ActionController::Routing::Routes.draw do |map| > map.connect '''', :controller => "home", :action => "home" > > snip > > app\controllers\home_controller.rb: > class HomeController < ApplicationController > def index > @title = "RTS: Receipts Tracking System" > end > end > > app\views\home\index.html.erb: > <div> > This is a Div section in Index.htms.erb > in app\views\home > </div> > > http://localhost:3000/ > Unknown action > > No action responded to home. Actions: index-- 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.