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
# config/initializers/extensions/active_record.rb | |
module ActiveRecord | |
class Base | |
class << self | |
delegate :pluck, to: :scoped | |
end | |
end | |
class CollectionProxy | |
delegate :pluck, to: :scoped |
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
// For reference: https://github.com/wagenet/ember.js/blob/ac66dcb8a1cbe91d736074441f853e0da474ee6e/packages/ember-handlebars/lib/views/bound_property_view.js | |
var BoundHelperView = Ember._MetamorphView.extend({ | |
context: null, | |
options: null, | |
property: null, | |
// paths of the property that are also observed | |
propertyPaths: [], | |
value: Ember.K, |
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
App.Router = Em.Router.extend({ | |
root: Em.Route.extend({ | |
route: '/', | |
user: Em.Route.extend({ | |
route: '/:user_id/', | |
connectOutlets: function (router, context) { | |
//What is context here? | |
// it's simple in the one segment case where | |
// its the return value of find on the model. | |
}, |
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
<script type="text/x-handlebars"> | |
<button {{action loadBooks target="Welcome.booksController"}}>Load Books</button> | |
{{#collection contentBinding="Welcome.booksController" tagName="ul"}} | |
<b>{{view.content.title}}</b> - {{view.content.author}}, <i>{{view.content.genre}}</i> | |
{{/collection}} | |
</script> |