-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from truenorth/use-adapter
Use ember-data adapter for ajaxOptions and ajax
- Loading branch information
Showing
8 changed files
with
80 additions
and
44 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
.payload { | ||
margin-left: 30px; | ||
} | ||
|
||
.m-t-40 { | ||
margin-top: 40px; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
|
||
<div class="container"> | ||
<h2 id="title">Ember api actions</h2> | ||
<div class="row"> | ||
<div class="col m8 s12"> | ||
<h2 id="title">Ember api actions</h2> | ||
</div> | ||
<div class="col m4 s12"> | ||
<a href="https://github.com/truenorth/ember-api-actions" class="btn btn-flat black white-text m-t-40" target="_blank">Go to Github</a> | ||
</div> | ||
</div> | ||
|
||
{{outlet}} | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
<h3>API actions on an individual resource</h3> | ||
{{#each content as |fruit|}} | ||
<p class='fruit-thing' {{bind-attr id=fruit.name}}> | ||
{{fruit.id}} {{fruit.name}} | ||
<button class='btn ripen-instance-button' {{action 'ripenFruit' fruit}}>Ripen</button> - calls <code>fruit.ripen()</code> | ||
</p> | ||
|
||
{{/each}} | ||
<h3>API action on a collection of resources</h3> | ||
<p class='all-fruit'> | ||
{{content.constructor.modelName}} | ||
<button class='btn ripen-type-button' {{action 'ripenAllFruit' content.firstObject}}>Ripen All</button> - calls <code>fruit.ripenAll()</code> | ||
</p> | ||
|
||
|
||
{{code-snippet name='fruit-model.js'}} | ||
|
||
<h5>Outgoing API Requests:</h5> | ||
<ul> | ||
{{#each requests as |req|}} | ||
<li> <code>{{req.url}}</code> <code class='payload'>{{json-string req.data}}</code></li> | ||
{{/each}} | ||
</ul> | ||
<div class="row"> | ||
<div class="col m6 s12"> | ||
<h4>API actions on an individual resource</h4> | ||
{{#each content as |fruit|}} | ||
<p class='fruit-thing' {{bind-attr id=fruit.name}}> | ||
<button class='btn ripen-instance-button' {{action 'ripenFruit' fruit}}>Ripen</button> | ||
{{fruit.name}} (id = {{fruit.id}}) | ||
- calls <code>fruit.ripen()</code> | ||
</p> | ||
{{/each}} | ||
<h4>API action on a collection of resources</h4> | ||
<p class='all-fruit'> | ||
{{content.constructor.modelName}} | ||
<button class='btn ripen-type-button' {{action 'ripenAllFruit' content.firstObject}}>Ripen All</button> - calls <code>fruit.ripenAll()</code> | ||
</p> | ||
</div> | ||
<div class="col m6 s12"> | ||
<h4>Outgoing API Requests:</h4> | ||
<ul> | ||
{{#each requests as |req|}} | ||
<li> <code>{{req.url}}</code> </li> | ||
{{/each}} | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col s12"> | ||
<b>app/models/fruit.js</b> | ||
{{code-snippet name='fruit-model.js'}} | ||
<b>app/controllers/index.js</b> | ||
{{code-snippet name='controller.js'}} | ||
</div> | ||
</div> |
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