Created
July 11, 2016 12:22
-
-
Save jetrubyshared/8b2b3829783595a398c20ca19c526deb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############### | |
## WRONG ## | |
############### | |
class API::ArticlesController | |
def index | |
@articles = Article.all | |
render json: @articles, status: 200 | |
end | |
end | |
############### | |
## RIGHT ## | |
############### | |
class API::ArticlesController | |
def index | |
articles = Article.all | |
render json: articles, status: 200 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment