ActionController::RoutingError (No route matches "/atweet"): Unsure on why routing to my view isn''t working. controller appears to be functioning, however the view isn''t work, when I attempt to go to it, this happens... sniff... sniff.... help??? I don''t get routes.rb in rails... -- 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.
Routes seems hard for the first time, but don''t worry, you will do it! ;) Usually works like this: map.connect ''/something/:id'', :controller => ''nameofcontroller'', :action => ''whattodo'' When you press the link, and you get the message what you did, it means you haven''t worked out the routing which tells for the Rails app where can find the result. Did you use scaffolding? Or made Rails app from scratch? It''s also important to note: the order of the lines in the routes.rb is important (at least it was important on Rails 2.3.X, I''m not sure about Rails3 in this, haven''t checked yet) Feel free to write me on private if you have further problems with it! good luck gezope ure on why routing to my view isn''t working. controller appears to be> functioning, however the view isn''t work, when I attempt to go to it, > this happens... sniff... sniff.... help??? > > I don''t get routes.rb in rails... > -- > 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-/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.
Andrew Jones
2010-Oct-08 06:37 UTC
Re: ActionController::RoutingError (No route matches "")
Zoltan Gero wrote:> Routes seems hard for the first time, but don''t worry, you will do > it! ;) > > Usually works like this: > > map.connect ''/something/:id'', :controller => > ''nameofcontroller'', :action => ''whattodo'' > >is that for rails 3? I''m using rails 3. the routes.rb does contain a line to route atweet to the atweet controller. I used the rubyguides.org documentation to write the routes.rb rake routes gives me an error. I made it using rails new project then rails generate controller atweet then rails generate model Soda I also had questions as to the interaction between controller and model, can I have the controller saving data into the model from inside the controller? - A -- 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.
Andrew Jones
2010-Oct-08 07:47 UTC
Re: ActionController::RoutingError (No route matches "")
For the record: match ''atweet'', :to => ''atweet'' i.e. in rails 3 match ''url'', :to => ''controller'' also new problem is: undefined method `action'' NoMethodError in AtweetController#atweet Still working on it. thanks for the help. - A -- 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.
Luke Cowell
2010-Oct-09 16:07 UTC
Re: Re: ActionController::RoutingError (No route matches "")
Try changing it to something like this: match ''atweet'', :to => ''atweet#index'' This would mean that in AtweetController the index method when you go to /atweet in your browser. Are you familiar with MVC ? If not, do a bit of googling. Luke On 2010-10-08, at 12:47 AM, Andrew Jones wrote:> For the record: > match ''atweet'', :to => ''atweet'' > > i.e. in rails 3 > match ''url'', :to => ''controller'' > > also new problem is: > undefined method `action'' > > NoMethodError in AtweetController#atweet > > Still working on it. > thanks for the help. > > - > A > -- > 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. >-- 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.
Andrew Jones
2010-Oct-10 05:22 UTC
Re: Re: ActionController::RoutingError (No route matches "")
Luke Cowell wrote:> Try changing it to something like this: > match ''atweet'', :to => ''atweet#index'' > > This would mean that in AtweetController the index method when you go to > /atweet in your browser. > > Are you familiar with MVC ? If not, do a bit of googling. > > Lukeyeah I understand #index means it calls the index method in my controller... although there actually wasn''t an index method in my controller I had to add one. Anyway, still getting the error undefined method ''action'' the controller does fire and queries my sql database, etc. though i tried adding def index my controller''s code end I also deleted the match :action/:controller/:id in the routes.rb file to simplify things. -- 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.
Apparently Analagous Threads
- ActionController::RoutingError (No route matches [GET] "/image.jpg"):
- ActionController::RoutingError (No route matches "/say/hello" with {:method=>:get}):
- Ruby with apache ActionController::RoutingError (No route matches "/"):
- ActionController::RoutingError (no route found to match "/ja
- ActionController::RoutingError