Skip to content

Instantly share code, notes, and snippets.

@jenweber
Last active August 12, 2017 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jenweber/48f937a6d96e340880c8167ccc80f898 to your computer and use it in GitHub Desktop.
Save jenweber/48f937a6d96e340880c8167ccc80f898 to your computer and use it in GitHub Desktop.
Minimal CRUD with Ember Data
<div>
Read all:
<ul>
{{#each model as |game|}}
<li>{{game.title}}, id {{game.id}}</li>
{{/each}}
</ul>
</div>
<div>
<button {{action 'readBoardGame'}}>Read Board Game 1</button>
</div>
<div>
{{input value=newBoardGame placeholder="board game name"}}
<button {{action 'createBoardGame'}}>Create</button>
</div>
<div>
{{input value=updatedTitle placeholder="new name for board game 1"}}
<button {{action 'updateBoardGame'}}>Update</button>
</div>
<div>
{{input value=destroyId placeholder="id of game to delete"}}
<button {{action 'destroyBoardGame'}}>Delete</button>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment