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
%table.table | |
%thead.table-active | |
%tr | |
%th Position | |
%th Name | |
%tbody | |
- @fruits.each do |fruit| | |
%tr.draggable{ draggable: true, id: "fruit-#{fruit.id}", data: { position: fruit.position, url: reorder_fruit_path(fruit, format: :js) }} | |
%td= fruit.position |
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
# for has_and_belongs_to_many, required true | |
= f.collection_check_boxes :ethnicity_ids, Ethnicity.all, :id, :name, {}, { required: true } do |e| | |
= e.label do | |
= e.check_box | |
= e.text | |
# or for has_many through with different wrappers | |
= f.collection_check_boxes :health_goal_ids, HealthGoal.ordered, :id, :name, boolean_style: :inline, item_wrapper_tag: nil do |goal| |
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
xcode-select --install | |
gem uninstall libv8 | |
gem uninstall therubyracer | |
brew rm v8 | |
brew tap homebrew/dupes | |
brew install apple-gcc42 | |
brew tap homebrew/versions | |
brew install v8-315 | |
brew link --force v8-315 | |
gem install libv8 -- --with-system-v8 |
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
# Create credentials json file | |
# 1. Go to Google API Console | |
# 2. Create credentials (Service Account Key). Note 'Service account ID' | |
# 3. Download key as 'google_auth.json' | |
# 4. Go to Google Analytics -> Admin -> View Settings. Note 'View ID' | |
# 5. Go to User Management -> Add permissions for: (Service account ID) [Read & Analyze] | |
# Terminal | |
export GOOGLE_APPLICATION_CREDENTIALS='config/google_auth.json' |