Skip to content

Instantly share code, notes, and snippets.

@mdoel
Created September 27, 2012 21:28
Show Gist options
  • Save mdoel/3796574 to your computer and use it in GitHub Desktop.
Save mdoel/3796574 to your computer and use it in GitHub Desktop.
gross_application_controller
class ApplicationController < ActionController::Base
before_filter :set_pagination_defaults, :inline_file_downloads
protect_from_forgery
layout 'general'
def set_pagination_defaults
params[:page] ||= 1
params[:per_page] ||= 10
end
def inline_file_downloads
# Force Dragonfly to view files attached to resources inline in the browser
::Dragonfly[:refinery_resources].configure do |c|
c.content_disposition = :inline
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment