workflow:
$ rails g model NameOfModel
invoke active_record
create db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb
$ sudo apt-get install python-pip python-dev build-essential | |
$ sudo pip install --upgrade pip | |
$ sudo pip install --upgrade virtualenv | |
sudo apt-get install redis-server | |
pip install flower |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
The normal controller/view flow is to display a view template corresponding to the current controller action, but sometimes we want to change that. We use render
in a controller when we want to respond within the current request, and redirect_to
when we want to spawn a new request.
The render
method is very overloaded in Rails. Most developers encounter it within the view template, using render :partial => 'form'
or render @post.comments
, but here we'll focus on usage within the controller.
# -*- encoding : utf-8 -*- | |
require 'net/http' | |
require 'json' | |
module CheckPurchaseStatus | |
CLIENT_ID = "xxxxxxxxxxxx" | |
CLIENT_SECRET = "xxxxxxxxxx" | |
REDIRECT_URIS = "https://xxxxxxxxxx" |
Something else I found helpful along the way (as I had old stuff installed): | |
gem uninstall --install-dir /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 rails |