Ruby on Rails - first impressions and a solution to a silly problem
Tonight I decided to give Ruby on Rails a try, as I tend to like playing with ruby, and I also like web applications. Therefore I search for “ruby on rails tutorial” on google, and found a wikipage which seemed like a nice tutorial. I already had ruby installed, and I followed the tutorial down to the #Hello#index-part before encountering any big problems. Rails generated a nice folder with subfolders for the mvc-pattern, configuration and a lot more.
I used Netbeans 6.5 as my IDE, as this is a neat editor with good ruby-support. It even had a “import ruby project” folder (File -> New Project -> Ruby -> Ruby on Rails Application with Existing Sources), so I used that function to import the generated folder.
With my webserver up and running, I was ready to check my new test page. In the tutorial I was supposed to visist http://localhost:3000/hello and get a nice page, instead I was faced with an exception, and the errormessage: “No route matches “/hello/” with {:method=>:get}”. I tried googling it, but found the solution by entering the Config/routes.rb-file, and adding the line
“map.connect ”, :controller => ‘hello’”
- which did the trick, and I was looking at rendered html code in my browser. Wow.