mirror of
https://github.com/samsonjs/grape-active_model_serializers.git
synced 2026-03-25 08:45:55 +00:00
Fix indentation on README.
This commit is contained in:
parent
7f243c017d
commit
4d785b4754
1 changed files with 8 additions and 8 deletions
16
README.md
16
README.md
|
|
@ -128,15 +128,15 @@ In Grape, you can get the same behavior by defining a `current_user`
|
|||
helper method:
|
||||
|
||||
```ruby
|
||||
helpers do
|
||||
def current_user
|
||||
@current_user ||= User.where( :access_token => params[:token]).first
|
||||
end
|
||||
|
||||
def authenticate!
|
||||
error!('401 Unauthenticated', 401) unless current_user
|
||||
end
|
||||
helpers do
|
||||
def current_user
|
||||
@current_user ||= User.where( :access_token => params[:token]).first
|
||||
end
|
||||
|
||||
def authenticate!
|
||||
error!('401 Unauthenticated', 401) unless current_user
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
Then, in your serializer, you could show or hide some elements
|
||||
|
|
|
|||
Loading…
Reference in a new issue