Skip to content

Instantly share code, notes, and snippets.

@jpadilla
Last active August 29, 2015 14:06
Show Gist options
  • Save jpadilla/581d60f56d846834c65c to your computer and use it in GitHub Desktop.
Save jpadilla/581d60f56d846834c65c to your computer and use it in GitHub Desktop.
import DS from 'ember-data';
import config from '../config/environment';
export default DS.LSAdapter.extend({
namespace: config.modulePrefix
});
import DS from 'ember-data';
export default DS.Model.extend({
name: DS.attr('string'),
text: DS.attr('string'),
created: DS.attr('date')
});
<h3 class="huge-placeholder-text">Create a new document or select one from the list.</h3>
<div class="container">
<div class="row">
<div class="col-sm-3">
{{#link-to 'documents.new' class="btn btn-default btn-create-document"}}Create Document{{/link-to}}
<hr>
<div class="list-group">
{{#each document in controller}}
{{#link-to 'document' document class="list-group-item"}}
<h4 class="list-group-item-heading">{{document.name}}</h4>
<p class="list-group-item-text">Created {{date-relative document.created}}</p>
{{/link-to}}
{{/each}}
</div>
</div>
<div class="col-sm-9">
{{outlet}}
</div>
</div>
</div>
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return this.store.find('document');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment