Version: 1.9.7
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
| # Speed things up by not loading Rails env | |
| config.assets.initialize_on_precompile = false |
| # Let’s consider an example. We will add the models as they are required. Right now the basic application has models User, Role and Permission. The relationship is as shown | |
| Role #the model to save the role | |
| :name # the role name | |
| :has_many :users | |
| :has_and_belongs_to_many :permissions | |
| User | |
| :name # user name | |
| :email # user email |
| _Originally published in June 2008_ | |
| When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work. | |
| To ensure we hired competent ruby developers at my last [job](http://www.tobi.com/), I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors. | |
| ## What to expect | |
| Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer. |
| <% flash.each do |type, message| %> | |
| <div class="alert <%= bootstrap_class_for(type) %> alert-dismissable fade in"> | |
| <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
| <%= message %> | |
| </div> | |
| <% end %> |
| #!/bin/bash -ex | |
| # Assumes: | |
| # homebrew | |
| # chruby | |
| # ruby-install | |
| # postgres.app | |
| # this bit might not be necessary, but can't hurt | |
| brew upgrade ruby-install |
| # Capistrano configuration | |
| # | |
| # require 'new_relic/recipes' - Newrelic notification about deployment | |
| # require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production. | |
| # set :deploy_via, :remote_cache - fetch only latest changes during deployment | |
| # set :normalize_asset_timestamps - no need to touch (date modification) every assets | |
| # "deploy:web:disable" - traditional maintenance page (during DB migrations deployment) | |
| # task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP |
| ssh-add ~/.ssh/id_rsa |
| def convert_to_hash(string) | |
| string.gsub(/[{}:]/,'').split(', ').inject({}) do |hash, str_value| | |
| splitted_value = str_value.split('=>') | |
| splitted_value.delete('') | |
| key,value = splitted_value | |
| if splitted_value.count > 2 | |
| new_str = str_value.split(key) | |
| new_str.delete('') | |
| value = convert_to_hash(new_str.last.to_s) |