1) create a RoR project on Netbean 2)generate scaffold car name:string power:string 3) db:create 4:)db:migrate 5) Run project now on http://localhost:3000/cars you can find the app and play a little , the app is WORKING and SAVE every car you create 6)generate scaffold animal name:string speed:string 7)db:migrate now on http://localhost:3000/cars the app still work but on http://localhost:3000/animals the app IS NOT SAVING AND IS NOT WORKING after you try to save an animal just redirect to animals witout saving 8) open routes.rb change FROM map.resources :animals map.resources :cars TO map.resources :cars map.resources :animals NOW BOTH APPS WORK FINE !!!! Why ? Is Netbeans generating a wrong file ? How can I change the apps priorty? -- 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 -~----------~----~----~----~------~----~------~--~---
I followed these exact steps, and didn''t get the stated behavior. Everything worked fine here (Rails 2.2.2, OS X 10.5). If anybody''s going to be able to solve your problem, they''ll need more information: - versions, versions, versions. Which Rails? Which Netbeans? Which operating system? - "not working" (even in all caps) isn''t a problem description. Does it throw an exception? What appears in development.log when the code is "not working"? --Matt Jones On Mar 3, 5:17 pm, "Simone R." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 1) create a RoR project on Netbean > > 2)generate scaffold car name:string power:string > > 3) db:create > > 4:)db:migrate > > 5) Run project > > now onhttp://localhost:3000/carsyou can find the app and play a little > , the app is WORKING and SAVE every car you create > > 6)generate scaffold animal name:string speed:string > > 7)db:migrate > > now onhttp://localhost:3000/carsthe app still work but onhttp://localhost:3000/animalsthe app IS NOT SAVING AND IS NOT WORKING > > after you try to save an animal just redirect to animals witout saving > > 8) open routes.rb change FROM > > map.resources :animals > map.resources :cars > > TO > map.resources :cars > map.resources :animals > > NOW BOTH APPS WORK FINE !!!! > > Why ? > Is Netbeans generating a wrong file ? > How can I change the apps priorty? > -- > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Product Version: NetBeans IDE 6.5 (Build 200811100001) Java: 1.5.0_16; Java HotSpot(TM) Client VM 1.5.0_16-132 System: Mac OS X version 10.4.11 running on ppc; MacRoman; it_IT (nb) Jruby 1.1.4 Rails 2.1.0 Not working means when you click on "create" you just get rediret to /animals but witout the creation of the animal (the green message "Animal was successfully created." ) dont show up in the developmet.log there is -------------------------------WHEN NOT WORKING------------------------ Processing AnimalsController#new (for 0:0:0:0:0:0:0:1%0 at 2009-03-04 23:09:53) [GET] Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo SGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlOGI1MjEyYWE4MGE5Y2M4NWRi YjAxZDdhMjljNmNhY2Q=--71ff32314b47ece66cddbf1b8b4b0a88a7c0e034 Parameters: {"controller"=>"animals", "action"=>"new"} [4;36;1mAnimal Columns (0.009045) [0m [0;1mSHOW FIELDS FROM `animals` [0m Rendering template within layouts/animals Rendering animals/new Completed in 0.08431 (11 reqs/sec) | Rendering: 0.03623 (42%) | DB: 0.00904 (10%) | 200 OK [http://localhost/animals/new] Processing AnimalsController#index (for 0:0:0:0:0:0:0:1%0 at 2009-03-04 23:10:01) [POST] Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo SGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlOGI1MjEyYWE4MGE5Y2M4NWRi YjAxZDdhMjljNmNhY2Q=--71ff32314b47ece66cddbf1b8b4b0a88a7c0e034 Parameters: {"authenticity_token"=>"6bcbdc49394efcb0a75d6e3c4f42ca1413119046", "animal"=>{"name"=>"prova", "speed"=>"45"}, "commit"=>"Create", "controller"=>"animals", "action"=>"index"} [4;35;1mAnimal Load (0.003691) [0m [0mSELECT * FROM `animals` [0m Rendering template within layouts/animals Rendering animals/index [4;36;1mAnimal Columns (0.012850) [0m [0;1mSHOW FIELDS FROM `animals` [0m Completed in 0.10228 (9 reqs/sec) | Rendering: 0.05008 (48%) | DB: 0.01654 (16%) | 200 OK [http://localhost/animals] --------------------------------------------------------------- ------------------------------WHEN WORKING--------------------- Processing AnimalsController#new (for 0:0:0:0:0:0:0:1%0 at 2009-03-04 23:13:18) [GET] Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo SGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlOGI1MjEyYWE4MGE5Y2M4NWRi YjAxZDdhMjljNmNhY2Q=--71ff32314b47ece66cddbf1b8b4b0a88a7c0e034 Parameters: {"controller"=>"animals", "action"=>"new"} [4;35;1mAnimal Columns (0.243448) [0m [0mSHOW FIELDS FROM `animals` [0m Rendering template within layouts/animals Rendering animals/new Completed in 0.32704 (3 reqs/sec) | Rendering: 0.03443 (10%) | DB: 0.24345 (74%) | 200 OK [http://localhost/animals/new] Processing AnimalsController#create (for 0:0:0:0:0:0:0:1%0 at 2009-03-04 23:13:33) [POST] Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo SGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlOGI1MjEyYWE4MGE5Y2M4NWRi YjAxZDdhMjljNmNhY2Q=--71ff32314b47ece66cddbf1b8b4b0a88a7c0e034 Parameters: {"authenticity_token"=>"6bcbdc49394efcb0a75d6e3c4f42ca1413119046", "animal"=>{"name"=>"cat", "speed"=>"24"}, "commit"=>"Create", "controller"=>"animals", "action"=>"create"} [4;36;1mAnimal Columns (0.009141) [0m [0;1mSHOW FIELDS FROM `animals` [0m [4;35;1mSQL (0.003233) [0m [0mBEGIN [0m [4;36;1mSQL (0.002171) [0m [0;1mSELECT `name` FROM `animals` WHERE (`animals`.name = ''cat'') [0m [4;35;1mAnimal Create (0.005102) [0m [0mINSERT INTO `animals` (`name`, `speed`, `created_at`, `updated_at`) VALUES(''cat'', ''24'', ''2009-03-04 22:13:33'', ''2009-03-04 22:13:33'') [0m [4;36;1mSQL (0.001975) [0m [0;1mCOMMIT [0m Redirected to http://localhost:3000/animals/5 Completed in 0.12255 (8 reqs/sec) | DB: 0.02162 (17%) | 302 Found [http://localhost/animals] Processing AnimalsController#show (for 0:0:0:0:0:0:0:1%0 at 2009-03-04 23:13:34) [GET] Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo SGFzaHsGOgtub3RpY2UiJUFuaW1hbCB3YXMgc3VjY2Vzc2Z1bGx5IGNyZWF0 ZWQuBjoKQHVzZWR7BjsGRjoMY3NyZl9pZCIlOGI1MjEyYWE4MGE5Y2M4NWRi YjAxZDdhMjljNmNhY2Q=--9c84144c48e92fef15a844da179c0dbe83475846 Parameters: {"controller"=>"animals", "action"=>"show", "id"=>"5"} [4;35;1mAnimal Columns (0.007139) [0m [0mSHOW FIELDS FROM `animals` [0m [4;36;1mAnimal Load (0.005988) [0m [0;1mSELECT * FROM `animals` WHERE (`animals`.`id` = 5) [0m Rendering template within layouts/animals Rendering animals/show Completed in 0.08003 (12 reqs/sec) | Rendering: 0.02279 (28%) | DB: 0.01313 (16%) | 200 OK [http://localhost/animals/5] -------------------------------------------------------------- i can switch between the working and the not working version just switching the order of resources your routes.rb when you follow my step contains map.resources :animals map.resources :cars OR map.resources :cars map.resources :animals ? -- 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 -~----------~----~----~----~------~----~------~--~---
Simone, you should restart your webserver after the second scaffolding (step 5). Regards Nicolai --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I agree with this - the problem you ran into was that the routes file didn''t get reloaded correctly. This is a known issue (see http://rails.lighthouseapp.com/projects/8994/tickets/981-fix-for-routing-optimization-code ) with the 2.1 series. I would *highly* recommend that you upgrade to 2.2.2, or even wait a bit for 2.3 to drop. Apart from supporting production sites, there''s very little reason to stay with older versions, and lots of reasons (read: fixed bugs) to move forward. --Matt Jones On Mar 4, 6:07 pm, Codeblogger <codeblog...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Simone, you should restart your webserver after the second scaffolding (step > 5). > Regards > Nicolai--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Matt Jones wrote:> I agree with this - the problem you ran into was that the routes file > didn''t get reloaded correctly. This is a known issue (see > http://rails.lighthouseapp.com/projects/8994/tickets/981-fix-for-routing-optimization-code > ) with the 2.1 series. I would *highly* recommend that you upgrade to > 2.2.2, or even wait a bit for 2.3 to drop. Apart from supporting > production sites, there''s very little reason to stay with older > versions, and lots of reasons (read: fixed bugs) to move forward. > > --Matt Jonesthis version is the one bundled with Netbeans (even with the beta 6.7 version) and Netbeans have a nice button "update Rails" but if I try to update bad things happen (gem conflict and so on) and I dont know how to manage this stuff. I will fix it later and go directly to 2.3 -- 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 -~----------~----~----~----~------~----~------~--~---