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
import React from 'react' | |
import codePush from 'react-native-code-push' | |
let codePushOptions = { installMode: codePush.InstallMode.ON_NEXT_RESUME, checkFrequency: codePush.CheckFrequency.ON_APP_RESUME } | |
export class CodePushComponent extends React.Component { | |
componentDidMount() { | |
codePush.sync() | |
} |
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
class Parent < ActiveRecord::Base | |
has_many :kids | |
accepts_nested_attributes_for :kids | |
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
class Kid < ActiveRecord::Base | |
belongs_to :parent | |
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
class ParentsController < ApplicationController | |
def new | |
@parent = User.new | |
2.times {@parent.kids.build} | |
# This creates a new, empty Parent instance and two empty kid instances belonging to the Parent. | |
end | |
def create | |
@parent = Parent.create(parent_params) | |
if @parent.save |
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
<%= form_for(@parent) do |f| %> | |
… parent attributes go here … | |
<ul> | |
<%= f.nested_fields_for :kids do |kids_form| %> | |
<li> | |
<%= kids_form.text_field :name %> | |
</li> | |
<% end %> | |
</ul> | |
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
<%= form_for(@parent) do |f| %> | |
… | |
<%= f.add_nested_fields_link :kids do %> | |
<span>New Kid</span> | |
<% 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
<%= form_for(@parent) do |f| %> | |
… parent attributes go here … | |
<ul> | |
<%= f.nested_fields_for :kids do |kids_form| %> | |
<li> | |
<%= kids_form.text_field :name %> | |
<%= kids_form.remove_nested_fields_link %> # Delete link | |
</li> | |
<% end %> | |
</ul> |
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
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSExceptionDomains</key> | |
<dict> | |
<key>localhost</key> | |
<dict> | |
<key>NSExceptionAllowsInsecureHTTPLoads</key> | |
<true/> | |
</dict> | |
</dict> |
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
[ | |
{ | |
"note": "C", | |
"octave": 0, | |
"frequency": 16.35, | |
}, | |
{ | |
"note": "C#", | |
"octave": 0, | |
"frequency": 17.32, |