This file contains 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
# gem install nokogiri | |
# gem install cld | |
# Use CLD, a wrapper around the google Compact Language Detector to detect the language that a | |
# webpage is in. Use Nokogiri to pull out the text of the page. | |
require 'cld' | |
require 'open-uri' | |
require 'nokogiri' |
This file contains 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
rvm pkg install openssl | |
rvm remove 1.9.3 | |
rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr --with-gcc=clang |
This file contains 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
# code to retrieve the collection - the to_json filtering works on a collection, or a single model record | |
render :json => collection.to_json(:only => [ :id, :name, :another_attribute]) |
This file contains 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
... | |
ActiveRecord::Base.include_root_in_json = false | |
... |
NewerOlder