Created
January 31, 2014 00:56
-
-
Save thiagogabriel/8724669 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
# rails-api App | |
class ArticlesController < ApplicationController | |
def index | |
@articles = Article.all | |
render json: @articles | |
end | |
def show | |
@article = Article.find(params[:id]) | |
fresh_when(@article) # <---- Can it return a json? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment