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

[DOCS] Update Resource helper docs #1069

Merged
merged 3 commits into from
Apr 23, 2017
Merged
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
22 changes: 22 additions & 0 deletions docs/v0.3.x/shorthands.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,28 @@ this.del('/contacts/:id');

{% include resource-shorthands-code-compare.html resource=resource equivalent=equivalent %}

If your route path and collection names do not match, you can define a relative
or absolute path using the *path* option:

{% capture resource %}
{% highlight js %}
this.resource('blog-posts', { path: '/posts' });
{% endhighlight %}
{% endcapture %}

{% capture equivalent %}
{% highlight js %}
this.get('/posts', 'blog-posts');
this.get('/posts/:id', 'blog-posts');
this.post('/posts', 'blog-posts');
this.put('/posts/:id', 'blog-posts');
this.patch('/posts/:id', 'blog-posts');
this.del('/posts/:id', 'blog-posts');
{% endhighlight %}
{% endcapture %}

{% include resource-shorthands-code-compare.html resource=resource equivalent=equivalent %}

Here is the full reference of actions' names you can pass to *only* / *except* options and the shorthands they stand for:

<div class='Table__wrapper'>
Expand Down