Skip to content

Instantly share code, notes, and snippets.

@kirillshevch
Last active February 3, 2017 16:27
Show Gist options
  • Save kirillshevch/cf3392b71c9a10348278e06ca521b473 to your computer and use it in GitHub Desktop.
Save kirillshevch/cf3392b71c9a10348278e06ca521b473 to your computer and use it in GitHub Desktop.
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