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
// lets say i have this Values table | |
id prop data | |
1 age {value: 21} | |
2 age {value: 40} | |
3 name {value: "Jane"} | |
4 name {value: "Joe"} | |
5 time {value: 12.2} | |
6 time {value: 21.4} |
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
/usr/local/rvm/rubies/ruby-1.9.2-p192/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': | |
The compiler failed to generate an executable file. (RuntimeError) | |
You have to install development tools first. |
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 update head | |
rvm --force install 1.9.2 | |
gem install bundle | |
## in your rails app | |
bundle | |
Installing nokogiri (1.4.2) with native extensions | |
... |
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
## Gemfile | |
# and rake tasks are available in development mode: | |
group :test do | |
gem "sample_models" | |
end | |
## unit test | |
require 'test_helper' |
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
user: | |
can: read a blog | |
author: | |
extends: user | |
can: write a blog | |
manager: | |
extends: author | |
can: publish a blog |
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
# lib/javascript_helper.rb | |
module ActionView | |
module Helpers | |
module JavaScriptHelper | |
def j(data) | |
escape_javascript(data) | |
end | |
end | |
end |
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
module RockNRole | |
def self.included(base) | |
base.send :extend, ClassMethods | |
end | |
module ClassMethods | |
def has_rockin_roles | |
send :include, InstanceMethods | |
end |