Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor readme updates #555

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ember-api-actions

[![Build Status](https://travis-ci.org/mike-north/ember-api-actions.svg?branch=master)](https://travis-ci.org/mike-north/ember-api-actions)
[![npm version](https://badge.fury.io/js/ember-api-actions.svg)](http://badge.fury.io/js/ember-api-actions)
[![npm version](https://badge.fury.io/js/ember-api-actions.svg)](https://badge.fury.io/js/ember-api-actions)
[![Code Climate](https://codeclimate.com/github/mike-north/ember-api-actions/badges/gpa.svg)](https://codeclimate.com/github/mike-north/ember-api-actions)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Expand Down Expand Up @@ -33,10 +33,11 @@ Rails.application.routes.draw do

resources :fruits do
member do
put 'ripen' to: 'fruits#ripen'
put 'ripen', to: 'fruits#ripen'
end

collection do
get 'citrus' to: 'fruits#citrus_index'
get 'citrus', to: 'fruits#citrus_index'
end
end

Expand All @@ -48,14 +49,10 @@ This is not immediately intuitive with ember-data, and these kinds of API endpoi
## Use

```sh
# ember-cli >= 0.2.3
ember install ember-api-actions

# ember-cli < 0.2.3
ember install:addon ember-api-actions
```

You can then add these "actions" (not to be confused with client-side ember.js actions) to your ember-data model
You can then add these "actions" to your ember-data model (not to be confused with ember.js component @actions):

**app/models/fruit.js**

Expand All @@ -78,7 +75,7 @@ export default DS.Model.extend({
});
```

you can then call these functions, and they will initiate API requests and return you the promise
With them setup, you can then call these functions, and they will initiate API requests and return the promise:

```js
// Pass data in, it will be sent in the POST or PUT request payload
Expand Down Expand Up @@ -151,7 +148,7 @@ Customizing your adapter should customize requests sent out via this library, al

**ember-api-actions uses the following methods on DS.Adapter**

- [buildURL](http://emberjs.com/api/data/classes/DS.RESTAdapter.html#method_buildURL) - for generating an action's URL
- [buildURL](https://emberjs.com/api/data/classes/DS.RESTAdapter.html#method_buildURL) - for generating an action's URL
- [ajax](https://github.com/emberjs/data/blob/v1.13.4/packages/ember-data/lib/adapters/rest-adapter.js#L836-L859) (private) - to actually make the API request and return a promise

## Installation
Expand All @@ -178,6 +175,6 @@ errors on deprecation

- `ember build`

For more information on using ember-cli, visit [http://ember-cli.com/](http://ember-cli.com/).
For more information on using ember-cli, visit [https://cli.emberjs.com/](https://cli.emberjs.com/).

![Analytics](https://ga-beacon.appspot.com/UA-66610985-1/mike-north/ember-api-actions/readme)