ssh root@YOURDOMAIN
adduser deploy
visudo # Add deploy ALL=(ALL) ALL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL | |
| # 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew | |
| # https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers | |
| # 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it | |
| gem install bundler | |
| # 1. Get edge Rails source (master branch) | |
| git clone https://github.com/rails/rails.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled. | |
| Using the code from twitter bootstrap documentation page, this code is customized for table header. | |
| Create the table with following layout - | |
| <table class="table-fixed-header"> | |
| <thead class="header"> | |
| <tr> | |
| <th>Column 1</th> | |
| <th>Column 2</th> | |
| <th>Column 3</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ApplicationController < ActionController::Base | |
| ... | |
| #Problem: | |
| #In rails 3.0.1+ it is no longer possible to do this anymore; | |
| # rescue_from ActionController::RoutingError, :with => :render_not_found | |
| # | |
| #The ActionController::RoutingError thrown is not caught by rescue_from. | |
| #The alternative is to to set a catch-all route to catch all unmatched routes and send them to a method which renders an error | |
| #As in http://techoctave.com/c7/posts/36-rails-3-0-rescue-from-routing-error-solution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo aptitude -y install nginx | |
| cd /etc/nginx/sites-available | |
| sudo rm default | |
| sudo cat > jenkins | |
| upstream app_server { | |
| server 127.0.0.1:8080 fail_timeout=0; | |
| } | |
| server { | |
| listen 80; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
NewerOlder