Say you have a model that has_many
of another model through a third, intermediary model.
class Foo
has_many :bar_infos
has_many :bars, through: :bar_infos
accepts_nested_attributes_for :bar_infos
end
angular.module('myModule', []) | |
.directive('myDirective', myDirective); | |
function myDirective () { | |
return { | |
restrict: 'E', | |
scope: { | |
inputName: '@', | |
model: '=' | |
}, |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Example</title> | |
</head> | |
<body> | |
<h1>Example</h1> | |
<section> | |
<!-- | |
I want to display these numbers in two columns like so: |
class ThingController < ApplicationController do | |
# ... | |
protected | |
def protected_thing | |
'foo' | |
end | |
private | |
# converts a png image to jpeg | |
# all transparent regions will be converted to white | |
convert -flatten source.png destination.jpg |
git for-each-ref --sort=-committerdate refs/heads/ |
git diff-tree --no-commit-id --name-only -r your-branch-name | xargs sed -ie 's/oldName/newName/g' |
angular.factory('foo', ['Restangular', (Restangular) => { | |
return Restangular.one('foo', 1); | |
}]); |
export const gatherChars = str => str | |
.match(/(.)\1*/g) | |
.map(s => `${s.charAt(0)}${s.length}`) | |
.join(''); |
function * fibonacci (one = 1, two = 1) { | |
let sum = one + two; | |
yield sum; | |
yield * fibonacci(two, sum); | |
} |
Say you have a model that has_many
of another model through a third, intermediary model.
class Foo
has_many :bar_infos
has_many :bars, through: :bar_infos
accepts_nested_attributes_for :bar_infos
end