3/20/2006

Things that I have found helpful in learning ruby and rails

A little chart I found somewhere (in the Programming Ruby book, I think): Example variable and class names Local: name, fishAndChips, x_axis, thx1138, _26 Global (accessible by the program): $debug, $CUSTOMER, $_, $plan9, $Global Instance (accessible by the object): @name, @point_1, @X, @_, @plan9 Class: @@total, @@symtab, @@N, @@x_pos, @@SINGLE Constants and Class Names: PI, FeetPerMile, String, MyClass, Jazz_Song
Because it is so easy to forget the command line commands... To list the version of rails installed, type gem list rails . To start the server, type ruby script\server. To create a new application, type rails name_of_application. To create a new controller, type ruby script/generate controller name_of_controller. To generate the entire scaffold, type ruby script/generate scaffold Table_Name Controller_Name. And don't forget form helpers like: <%= link_to "Display_Link_Name", :action => "corresponding_action_in_the_controller" %>

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?