Phlip wrote:> Can I fix it by adding a view called ''inventories''?That worked, because I have a sufficiently late version of MySQL. Next question. What does "Set up a default route" mean? When I read... http://wiki.rubyonrails.com/rails/pages/Routes ...it reminds me of the Apache documentation for mod_rewrite. I hope someone appreciates the candor of my naivete'' and works on the "simplest path" through this stuff. I add... map.connect ''inventories'', :view => ''inventories'', :controller => ''inventory'' to config/routes.rb, and hit http://localhost:8000/inventories , and get a missing page message. What''s the simplest configuration to hit a view? -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!
On Aug 15, 2006, at 2:33 PM, Phlip wrote:> Phlip wrote: > >> Can I fix it by adding a view called ''inventories''? > > That worked, because I have a sufficiently late version of MySQL. > > Next question. What does "Set up a default route" mean? > > When I read... > > http://wiki.rubyonrails.com/rails/pages/Routes > > ...it reminds me of the Apache documentation for mod_rewrite. I hope > someone appreciates the candor of my naivete'' and works on the > "simplest path" through this stuff. > > I add... > > map.connect ''inventories'', :view => ''inventories'', :controller => > ''inventory'' > > to config/routes.rb, and hit http://localhost:8000/inventories , and > get a missing page message. > > What''s the simplest configuration to hit a view?Generally you hit an action, not a view. The action determines what view to load (defaults to the view with the same name) try: map.connect ''inventories'', :controller => ''inventory'', :action => ''inventories'' You''ll need an ''inventory'' controller that has an ''inventories'' method. But you can also access that with: localhost:8000/inventory/inventories Assuming you didn''t change the routes file too much. Anyway, the default route usually refers to : map.connect '''' ... So that way browsing to http://localhost:port/ yields part of your app, rather than public/index.html -Mat
Mat Schaffer wrote:> You''ll need an ''inventory'' controller that has an ''inventories'' method.Thanks - I''l try those and reply. The general topic here is the "getting started" documentation worked fine for installing Rails - even a newbie could do it (except on Ubuntu). Then the documentation sort of cliffed-over and dropped flat. The effect was kind of like following a trail of breadcrumbs through the forest and discovering they stop suddenly. (Wilderness tip: Don''t drop breadcrumbs. Break off twigs in the direction you are going...) -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!
On Aug 15, 2006, at 3:25 PM, Phlip wrote:> Mat Schaffer wrote: > >> You''ll need an ''inventory'' controller that has an ''inventories'' >> method. > > Thanks - I''l try those and reply. > > The general topic here is the "getting started" documentation worked > fine for installing Rails - even a newbie could do it (except on > Ubuntu).Well, so long as the command ''rails MyApp works, it should become pretty much the same on any platform. You might want to pick up another trail of crumbs... er... twigs. What are you reading? Perhaps it''s a wiki page that could use some attention. -Mat
Mat Schaffer wrote:> You''ll need an ''inventory'' controller that has an ''inventories'' method.Back to the generator. What''s wrong with this? ruby script/generate ajax_scaffold Inventory> localhost:8000/inventory/inventoriesThat''s a page-not-found right now, with "File does not exist: C:/phlip/projects/rails/public/inventory" in the log.> What are you reading?The "Welcome aboard" default page. Couldn''t it ass-ume MySQL, and then step you just as far as a Hello World situation? -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!
Phlip wrote:> Mat Schaffer wrote: > >> You''ll need an ''inventory'' controller that has an ''inventories'' method. > > Back to the generator. What''s wrong with this? > > ruby script/generate ajax_scaffold Inventory > >> localhost:8000/inventory/inventories > > That''s a page-not-found right now, with "File does not exist: > C:/phlip/projects/rails/public/inventory" in the log. > >> What are you reading? > > The "Welcome aboard" default page. > > Couldn''t it ass-ume MySQL, and then step you just as far as a Hello > World situation?If this is your first trip in the world of Rails, may I recommend that you try a brief tutorial (such as the ''Four Days with Rails'') which will give you a trip round the amusement park and introduce you to the attractions. There is a lot of ''magic'' that goes with Rails, but it does help to get your concepts almost right. You definitely come across a person who has the knowledge, but just needs the orientation :D As such, ajax_scaffold is not part of standard Rails (as I know it) and that may be throwing up some issues for you. Try the basic stuff first and it should all work. Cheers Mohit.