Hi, I just created a scaffolding controller and tried to run the tests and see it in the web browser. The problem is that I don''t think the routes were setup properly or at all. I get this error when I run the tests: ActionController::RoutingError: No route matches {:task=>{"created_at"=>2010-10-12 03:06:22 UTC, "id"=>980190962, "name"=>nil, "updated_at"=>2010-10-12 03:06:22 UTC, "value"=>nil}, :controller=>"tasks", :action=>"create"} test/functional/tasks_controller_test.rb:21:in `block (2 levels) in <class:TasksControllerTest>'' test/functional/tasks_controller_test.rb:20:in `block in <class:TasksControllerTest>'' So all the tests fail. Likewise, http://localhost:3000/tasks/ gives this error: No route matches "/tasks" This is a fresh install of a rails application, so I didn''t do anything to mess it up ;) I''m assuming rails is suppose to infer these urls/routes through convention? Why isn''t it doing that? Thanks -- 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.
Run rake routes to see your routes. On Oct 11, 8:10 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I just created a scaffolding controller and tried to run the tests > and see it in the web browser. The problem is that I don''t think the > routes were setup properly or at all. I get this error when I run the > tests: > > ActionController::RoutingError: No route matches > {:task=>{"created_at"=>2010-10-12 03:06:22 UTC, "id"=>980190962, > "name"=>nil, "updated_at"=>2010-10-12 03:06:22 UTC, > "value"=>nil}, :controller=>"tasks", :action=>"create"} > test/functional/tasks_controller_test.rb:21:in `block (2 levels) in > <class:TasksControllerTest>'' > test/functional/tasks_controller_test.rb:20:in `block in > <class:TasksControllerTest>'' > > So all the tests fail. Likewise,http://localhost:3000/tasks/gives > this error: > > No route matches "/tasks" > > This is a fresh install of a rails application, so I didn''t do > anything to mess it up ;) I''m assuming rails is suppose to infer these > urls/routes through convention? Why isn''t it doing that? > > Thanks-- 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.
Thanks very much for your response. I actually ran this command already. This is what it prints out: ********@ubuntu:~/RubymineProjects/blog$ rake routes (in /home/egervari/RubymineProjects/blog) ********@ubuntu:~/RubymineProjects/blog$ So... basically nothing. On Oct 11, 11:14 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Run rake routes to see your routes. > > On Oct 11, 8:10 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, I just created a scaffolding controller and tried to run the tests > > and see it in the web browser. The problem is that I don''t think the > > routes were setup properly or at all. I get this error when I run the > > tests: > > > ActionController::RoutingError: No route matches > > {:task=>{"created_at"=>2010-10-12 03:06:22 UTC, "id"=>980190962, > > "name"=>nil, "updated_at"=>2010-10-12 03:06:22 UTC, > > "value"=>nil}, :controller=>"tasks", :action=>"create"} > > test/functional/tasks_controller_test.rb:21:in `block (2 levels) in > > <class:TasksControllerTest>'' > > test/functional/tasks_controller_test.rb:20:in `block in > > <class:TasksControllerTest>'' > > > So all the tests fail. Likewise,http://localhost:3000/tasks/gives > > this error: > > > No route matches "/tasks" > > > This is a fresh install of a rails application, so I didn''t do > > anything to mess it up ;) I''m assuming rails is suppose to infer these > > urls/routes through convention? Why isn''t it doing that? > > > Thanks-- 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.
What''s in your config/routes.rb file? On Oct 11, 8:22 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks very much for your response. > > I actually ran this command already. This is what it prints out: > > ********@ubuntu:~/RubymineProjects/blog$ rake routes > (in /home/egervari/RubymineProjects/blog) > ********@ubuntu:~/RubymineProjects/blog$ > > So... basically nothing. > > On Oct 11, 11:14 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Run rake routes to see your routes. > > > On Oct 11, 8:10 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, I just created a scaffolding controller and tried to run the tests > > > and see it in the web browser. The problem is that I don''t think the > > > routes were setup properly or at all. I get this error when I run the > > > tests: > > > > ActionController::RoutingError: No route matches > > > {:task=>{"created_at"=>2010-10-12 03:06:22 UTC, "id"=>980190962, > > > "name"=>nil, "updated_at"=>2010-10-12 03:06:22 UTC, > > > "value"=>nil}, :controller=>"tasks", :action=>"create"} > > > test/functional/tasks_controller_test.rb:21:in `block (2 levels) in > > > <class:TasksControllerTest>'' > > > test/functional/tasks_controller_test.rb:20:in `block in > > > <class:TasksControllerTest>'' > > > > So all the tests fail. Likewise,http://localhost:3000/tasks/gives > > > this error: > > > > No route matches "/tasks" > > > > This is a fresh install of a rails application, so I didn''t do > > > anything to mess it up ;) I''m assuming rails is suppose to infer these > > > urls/routes through convention? Why isn''t it doing that? > > > > Thanks-- 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.
Basically nothing. I don''t think the generators put anything here for me. RjsDemo::Application.routes.draw do # lots and lots of comments end On Oct 11, 11:34 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What''s in your config/routes.rb file? > > On Oct 11, 8:22 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Thanks very much for your response. > > > I actually ran this command already. This is what it prints out: > > > ********@ubuntu:~/RubymineProjects/blog$ rake routes > > (in /home/egervari/RubymineProjects/blog) > > ********@ubuntu:~/RubymineProjects/blog$ > > > So... basically nothing. > > > On Oct 11, 11:14 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Run rake routes to see your routes. > > > > On Oct 11, 8:10 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, I just created a scaffolding controller and tried to run the tests > > > > and see it in the web browser. The problem is that I don''t think the > > > > routes were setup properly or at all. I get this error when I run the > > > > tests: > > > > > ActionController::RoutingError: No route matches > > > > {:task=>{"created_at"=>2010-10-12 03:06:22 UTC, "id"=>980190962, > > > > "name"=>nil, "updated_at"=>2010-10-12 03:06:22 UTC, > > > > "value"=>nil}, :controller=>"tasks", :action=>"create"} > > > > test/functional/tasks_controller_test.rb:21:in `block (2 levels) in > > > > <class:TasksControllerTest>'' > > > > test/functional/tasks_controller_test.rb:20:in `block in > > > > <class:TasksControllerTest>'' > > > > > So all the tests fail. Likewise,http://localhost:3000/tasks/gives > > > > this error: > > > > > No route matches "/tasks" > > > > > This is a fresh install of a rails application, so I didn''t do > > > > anything to mess it up ;) I''m assuming rails is suppose to infer these > > > > urls/routes through convention? Why isn''t it doing that? > > > > > Thanks-- 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.
Okay, I think I fixed it: I added this line and that works: resources :tasks Phew... On Oct 11, 11:36 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Basically nothing. I don''t think the generators put anything here for > me. > > RjsDemo::Application.routes.draw do > # lots and lots of comments > end > > On Oct 11, 11:34 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > What''s in your config/routes.rb file? > > > On Oct 11, 8:22 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Thanks very much for your response. > > > > I actually ran this command already. This is what it prints out: > > > > ********@ubuntu:~/RubymineProjects/blog$ rake routes > > > (in /home/egervari/RubymineProjects/blog) > > > ********@ubuntu:~/RubymineProjects/blog$ > > > > So... basically nothing. > > > > On Oct 11, 11:14 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Run rake routes to see your routes. > > > > > On Oct 11, 8:10 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Hi, I just created a scaffolding controller and tried to run the tests > > > > > and see it in the web browser. The problem is that I don''t think the > > > > > routes were setup properly or at all. I get this error when I run the > > > > > tests: > > > > > > ActionController::RoutingError: No route matches > > > > > {:task=>{"created_at"=>2010-10-12 03:06:22 UTC, "id"=>980190962, > > > > > "name"=>nil, "updated_at"=>2010-10-12 03:06:22 UTC, > > > > > "value"=>nil}, :controller=>"tasks", :action=>"create"} > > > > > test/functional/tasks_controller_test.rb:21:in `block (2 levels) in > > > > > <class:TasksControllerTest>'' > > > > > test/functional/tasks_controller_test.rb:20:in `block in > > > > > <class:TasksControllerTest>'' > > > > > > So all the tests fail. Likewise,http://localhost:3000/tasks/gives > > > > > this error: > > > > > > No route matches "/tasks" > > > > > > This is a fresh install of a rails application, so I didn''t do > > > > > anything to mess it up ;) I''m assuming rails is suppose to infer these > > > > > urls/routes through convention? Why isn''t it doing that? > > > > > > Thanks-- 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.
nice! On Oct 11, 8:44 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Okay, I think I fixed it: > > I added this line and that works: > > resources :tasks > > Phew... > > On Oct 11, 11:36 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Basically nothing. I don''t think the generators put anything here for > > me. > > > RjsDemo::Application.routes.draw do > > # lots and lots of comments > > end > > > On Oct 11, 11:34 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > What''s in your config/routes.rb file? > > > > On Oct 11, 8:22 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Thanks very much for your response. > > > > > I actually ran this command already. This is what it prints out: > > > > > ********@ubuntu:~/RubymineProjects/blog$ rake routes > > > > (in /home/egervari/RubymineProjects/blog) > > > > ********@ubuntu:~/RubymineProjects/blog$ > > > > > So... basically nothing. > > > > > On Oct 11, 11:14 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Run rake routes to see your routes. > > > > > > On Oct 11, 8:10 pm, egervari <ken.egerv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Hi, I just created a scaffolding controller and tried to run the tests > > > > > > and see it in the web browser. The problem is that I don''t think the > > > > > > routes were setup properly or at all. I get this error when I run the > > > > > > tests: > > > > > > > ActionController::RoutingError: No route matches > > > > > > {:task=>{"created_at"=>2010-10-12 03:06:22 UTC, "id"=>980190962, > > > > > > "name"=>nil, "updated_at"=>2010-10-12 03:06:22 UTC, > > > > > > "value"=>nil}, :controller=>"tasks", :action=>"create"} > > > > > > test/functional/tasks_controller_test.rb:21:in `block (2 levels) in > > > > > > <class:TasksControllerTest>'' > > > > > > test/functional/tasks_controller_test.rb:20:in `block in > > > > > > <class:TasksControllerTest>'' > > > > > > > So all the tests fail. Likewise,http://localhost:3000/tasks/gives > > > > > > this error: > > > > > > > No route matches "/tasks" > > > > > > > This is a fresh install of a rails application, so I didn''t do > > > > > > anything to mess it up ;) I''m assuming rails is suppose to infer these > > > > > > urls/routes through convention? Why isn''t it doing that? > > > > > > > Thanks-- 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, default routes are commented out by default in rails 3 as a security issue. So you can''t reach any action on your controllers if you just know or guess the name of it. /:controller(/:action(/:id))(.:format) You can comment it in again if you want to. It is at the bottom of routes.rb. Max. Am 12.10.2010 05:10, schrieb egervari:> Hi, I just created a scaffolding controller and tried to run the tests > and see it in the web browser. The problem is that I don''t think the > routes were setup properly or at all. I get this error when I run the > tests: > > ActionController::RoutingError: No route matches > {:task=>{"created_at"=>2010-10-12 03:06:22 UTC, "id"=>980190962, > "name"=>nil, "updated_at"=>2010-10-12 03:06:22 UTC, > "value"=>nil}, :controller=>"tasks", :action=>"create"} > test/functional/tasks_controller_test.rb:21:in `block (2 levels) in > <class:TasksControllerTest>'' > test/functional/tasks_controller_test.rb:20:in `block in > <class:TasksControllerTest>'' > > So all the tests fail. Likewise, http://localhost:3000/tasks/ gives > this error: > > No route matches "/tasks" > > This is a fresh install of a rails application, so I didn''t do > anything to mess it up ;) I''m assuming rails is suppose to infer these > urls/routes through convention? Why isn''t it doing that? > > Thanks >-- 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.