/ Published in: Rails
URL: http://support.tigertech.net/freeze-rails#2
Expand |
Embed | Plain Text
############################### #Generating a Model ############################### #Generate a new User Model ruby script/generate model User ############################### #Generating a Controller ############################### #Generate a new controller with html page ruby script/generate controller <ControllerName> [optional actions] ruby script/generate controller Site index help about ############################### #Out of the box helper methods ############################### #HREF's link_to "Home", :action => "index" <%= link_to_unless_current "Home", { :action => "index"}, { :id => "home" } %> link_to_if link_to_image link_to_remote link_to_unless ############################### #Rails Testing ############################### #Test a controller using functional tests ruby -Itest test/functional/nameOfController_controller.rb #Prepare a project for Rails testing by copying the db dev env into test db rake db:test:prepare #Test a model through unit rake test:units #Run both functional tests and unit tests rake #Check out your code to test ratios rake stats ############################### #BASH Commands ############################### #Setting MySQL in your environment variables echo 'export PATH=/usr/local/mysql/bin:$PATH' >> ~/.bash_profile #Update rails gem update rails gem update rails --include-dependencies #Install MySQL adaptor for Rails +2.2 for OSX 10.5 gem install mysql --include-dependencies #Install MySQL adaptor for Rails +2.2 for OSX 10.6 (This is for Intel Core 2 Duo Macs) #If you hit trouble with OsX10.6.6 -> http://stackoverflow.com/questions/4605659/mysql-wont-start-on-mac-osx sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config #Install MySQL adaptor for Rails +2.2 for OSX 10.4 (32-bit or Indtel Core Duo Macs) sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config #Update Gem System gem update --system ############################### #Capistrano ############################### $ capify /path/to/rails/application/
You need to login to post a comment.
