Skip to content

Instantly share code, notes, and snippets.

View siwilkins's full-sized avatar

Si Wilkins siwilkins

View GitHub Profile
@siwilkins
siwilkins / gist:5c6e35122be9be2cb8b8
Created August 7, 2014 14:45
Fixed controller to resolve problem with dragonfly caching
class Admin::SermonsController < ApplicationController
expose(:sermons) { policy_scope(Sermon) }
expose :sermon, attributes: :sermon_params, finder: :find_by_url
expose(:paginated_sermons) { sermons.page(params[:page]) }
before_action :authorize_sermon, except: :index
def index
authorize(sermons)