Created
September 27, 2012 21:28
-
-
Save mdoel/3796574 to your computer and use it in GitHub Desktop.
gross_application_controller
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 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