The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
# Potential solution to "Using accepts_nested_attributes_for with a belongs_to association, and using find_or_create_by_attr behaviour" | |
# http://stackoverflow.com/questions/2970255/using-accepts-nested-attributes-for-with-a-belongs-to-association-and-using-find | |
class Upload < AR:B | |
belongs_to :user | |
belongs_to :observed_property | |
belongs_to :sensor | |
attr_accessor :observed_property_attributes, | |
:sensor_attributes | |
javascript: function iprl5() % 7Bvar d = document, | |
z = d.createElement('scr' + 'ipt'), | |
b = d.body, | |
l = d.location; | |
try % 7Bif(!b) throw (0); | |
d.title = '(Saving...) ' + d.title; | |
z.setAttribute('src', l.protocol + '//localhost:5000/listings/91.js'); | |
b.appendChild(z); % 7Dcatch(e) % 7Balert('Please wait until the page has loaded.'); % 7D % 7Diprl5(); | |
void(0) |
/* | |
* Title Caps | |
* | |
* Ported to JavaScript By John Resig - http://ejohn.org/ - 21 May 2008 | |
* Original by John Gruber - http://daringfireball.net/ - 10 May 2008 | |
* License: http://www.opensource.org/licenses/mit-license.php | |
*/ | |
(function(){ | |
var small = "(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v[.]?|via|vs[.]?)"; |
// This file contains utilities for creating bound helpers | |
// For reference: https://github.com/wagenet/ember.js/blob/ac66dcb8a1cbe91d736074441f853e0da474ee6e/packages/ember-handlebars/lib/views/bound_property_view.js | |
Ember.Handlebars.BoundHelperView = Ember.View.extend(Ember._Metamorph, { | |
context: null, | |
options: null, | |
property: null, | |
// paths of the property that are also observed | |
propertyPaths: [], |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Ember.js Router Example</title> | |
<meta name="description" content="Example of a basic Ember.js application with a Router" /> | |
<meta name="author" content="http://codebrief.com" /> | |
<!--[if lt IE 9]> | |
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> |
For those folks not already hanging out in #documentcloud... here's the log of this afternoon's Ember/Backbone politics discussion. | |
12:21 PM <wycats> how would you like me to describe backbone? | |
12:21 PM <wycats> let's work this out for once and for all :) | |
12:21 PM <wycats> I'm definitely not intentionally saying incorrect things about backbone | |
12:24 PM <jashkenas> don't worry about it too much -- I'm just not terribly pleased with backbone being continued to be used as the strawman... | |
12:24 PM <wycats> jashkenas: I am worried about it a lot | |
12:25 PM <wycats> jashkenas: what particularly am I saying that is unfair? | |
12:25 PM <jashkenas> If we're going to continue making intentionally slanted direct comparisons, then perhaps we should just add "Why Ember and not Backbone" and "Why Backbone and not Ember" sections to our respective sites ... so folks can at least read both sides. | |
12:27 PM <jashkenas> The main point is that all of the specific bits that you call out as limitations of Backbone, that Ember tries t |