Skip to content

Commit

Permalink
0.4.3 version
Browse files Browse the repository at this point in the history
  • Loading branch information
polakowski committed Mar 28, 2018
1 parent 83a7b48 commit 5c376b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
resourcey (0.4.2)
resourcey (0.4.3)
active_model_serializers (~> 0.10.6)
activerecord (>= 4)
railties (>= 4)
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@

### 0.4.0
- feature: allow to configure resourcey/controller superclass

### 0.4.3
- feature: add `collection_scope` to controller (it allows to scope resources)
- `use_model` method can receive model name, or model class
6 changes: 5 additions & 1 deletion docs/CONTROLLER.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
Controller (`Resourcey::Controller` class) gives you ability to perform REST actions on your resources.

## Controller model
For controller named `UsersController`, model is `User` by default (it uses `controller_name` method from the `ActionController::Base`). If you want to change model used by controller, just call `use_model` method inside, and pass model class:
For controller named `UsersController`, model is `User` by default (it uses `controller_name` method from the `ActionController::Base`). If you want to change model used by controller, just call `use_model` method inside, and pass model class or model name:
```ruby
class AdminsController < Resourcey::Controller
use_model User
# or
use_model :user
# or
use_model 'User'
end
```

Expand Down

0 comments on commit 5c376b7

Please sign in to comment.