Skip to content

Instantly share code, notes, and snippets.

@thiagogabriel
Created January 31, 2014 00:56
Show Gist options
  • Save thiagogabriel/8724669 to your computer and use it in GitHub Desktop.
Save thiagogabriel/8724669 to your computer and use it in GitHub Desktop.
# 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