Last active
February 3, 2017 16:27
-
-
Save kirillshevch/cf3392b71c9a10348278e06ca521b473 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
class PostsController < ApplicationController | |
before_action :authenticate | |
caches_action :index, :show | |
def index | |
@posts = Post.all | |
end | |
def show | |
@post = Post.find_by(id: params[:id]) | |
end | |
private | |
def authenticate | |
# Your authenticate logic | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment