Skip to content

Commit

Permalink
Updating the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumebriday committed Sep 24, 2019
1 parent b5abde8 commit 4de83bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
[![](https://img.shields.io/github/license/guillaumebriday/jsonapi-scopes.svg)](https://github.com/guillaumebriday/jsonapi-scopes)

# Jsonapi::Scopes
This gem allows you to filter and sort an ActiveRecord relation based on a request. This gem follows the [JSON:API specification](https://jsonapi.org/) as closely as possible.
This gem provides a set of methods which allow you to include, filter and sort an ActiveRecord relation based on a request. It's build to be a simple, robust and scalable system. This gem follows the [JSON:API specification](https://jsonapi.org/) as closely as possible.

This gem is also an unopinionated solution to help you follow the `JSON:API specification`. It does not take care how you want to handle the results. It is a seamless integration in your Rails application and not full library.

## Installation
Add this line to your application's Gemfile:
Expand Down Expand Up @@ -57,7 +59,7 @@ You can specify multiple matching filter values by passing a comma separated lis
But `/contacts?filter[last_name]=Wayne` will be completely ignored.

### Sorting
The gem add `default_sort` and `sortable_fields` methods to control sort options. **Both are optional** and can be overriding in controllers.
The gem add `default_sort` and `sortable_fields` methods to control sort options. They can be overridden in controllers.

```ruby
class Contact < ActiveRecord::Base
Expand Down

0 comments on commit 4de83bc

Please sign in to comment.