LDAP and Authentication http://wiki.rubyonrails.org/rails/pages/HowtoAuthenticateViaLdap Without ActiveLDAP: http://wiki.rubyonrails.org/rails/pages/HowtoAuthenticateWithRubyNetLdap Ruby Reference http://www.digitalsanctum.com/ruby-reference/ Relational Data and Forms (has_many): http://wiki.rubyonrails.org/rails/pages/TutorialRelationalForms Visualizing Models: http://visualizemodels.rubyforge.org/ TipSheet for Beginners: http://wiki.rubyonrails.com/rails/pages/TipSheetForBeginners Google Groups http://groups.google.com/group/rubyonrails-talk?hl=en Rake Rake Your Boat http://nubyonrails.com/articles/2006/02/25/rake-rake-rake-your-boat --- * Install MySQL Database First * Then make/install ruby * Then make/install gems * Otherwise your database.yml will be confused as to where the mysql.sock is, requiring a change to database.yml #socket: /var/lib/mysql/mysql.sock Note: Rail's initial MySQL connector is evidently crappy so install the low level one: * Actually then you gotta install the damn MySQL Ruby library # gem install mysql -- --with-mysql-config=`which mysql_config` (This should prevent the "Can't find /tmp/mysql.sock" error you may get. Find out where your socket is: mysql_config --socket -- Create your application skeleton and start the server: rails path/to/your/new/application cd path/to/your/new/application ruby script/server You're running Ruby on Rails! Follow the instructions on http://localhost:3000. --- Then: * Create your dev, test, and production database * Modify database.yml * Try your first rake % cd test % rake db:migrate (This should work without issues) * Startup your server again (tho this should still be running but just in case) % ruby script/server --- http://whatever.com/say/hello say -> controller hello -> action Theory: app/controllers - Controller classes - controller handles a web request from user app/views - display HTML templates /layouts/ application layout applies to everything in the application app/models - wraps the data -> MVC: All data logic should be in models as much as possible, not the views or controllers apps/helpers - helper classes components/ DEPRECATED config/ -> Application Configuration data environment.rb -> Application Configuration data test/ lib/ shared code between model<->view<->controller public/ htdocs script/ plugin/ runner/ cron jobs here, or handle incoming methods server/ tmp/ temp directory log/ log directory vendor/ third party directories (rake rails:freeze:gems; rake rails:unfreeze) --- --- Naming Conventions Classes : ClassOne Variables: some_item Files : some_file_with_underscores Database Column Types :binary, :boolean, :date, :datetime, :decimal, :float, :integer, :string, :text, :time, :timestamp :null => true|false, :limit => size, :default =>value ---- Handy Cheatsheet Create a new app: % rails app_name ruby script/server Controllers: ruby script/generate controller controller_name ruby script/generate controller store index # Create controller named "store" with "index" action ruby script/destroy controller store # Destroys the store controller Models: ruby script/generate model nonPluralModel rake db:migrate ruby script/generate migration add_price # Add column ruby script/generate migration create_table # Add new table ruby script/generate migration rename_table # Rename Table ruby script/generate migration add_test_data # Add data in the db/migrate/003_add_test_data.rb # Static Scaffolds ruby script/generate scaffold model_name controller_name # Redoing a rake rake db:migrate VERSION=2 rake db:migrate VERSION=3 if you canted db/migrate/003_add_test_data.rb Freezing Rails (sticks rails framework into vendor directory): rake rails:freeze:gems rake rails:unfreeze Sessions in Database instead of filesystem rake db:sessions:create rake db:migrate Rake Tasks rake --tasks rake log:clear # Truncate all *.log files to zero bytes rake tmp:clear # Clears out files in tmp directory rake stats # Code stats