adding ruby tag to code blocks

This commit is contained in:
CodedBeardedSignedTaylor 2016-02-28 22:45:45 -05:00
parent 558769981e
commit 6a8da1f664

View File

@ -2,7 +2,7 @@
Let's say you have a basic Post Controller:
```
```ruby
class PostController < ApplicationController
def dashboard
render json: @posts
@ -12,7 +12,7 @@ end
Odds are, your serializer will look something like this:
```
```ruby
class PostSerializer < ActiveModel::Serializer
attributes :id, :title, :body
end
@ -23,7 +23,7 @@ into the serializer. Here's what you would do:
### posts_controller.rb
```
```ruby
...
def dashboard
render json: @posts, user_id: 12
@ -33,7 +33,7 @@ into the serializer. Here's what you would do:
### posts_serializer.rb
```
```ruby
...
def comments_by_me
Comments.where(user_id: instance_options[:user_id], post_id: object.id)