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
# Disable maintenance page | |
Chef::Log.info("Disabling maintenance page") | |
file "/srv/www/your_app/shared/system/maintenance.html" do | |
action :delete | |
end |
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
# config/initializers/will_paginate_helper.rb | |
# Tested with will_paginate v3.0.7 | |
module WillPaginate | |
module ActionView | |
class LinkRenderer < ViewHelpers::LinkRenderer | |
include ListingHelper | |
protected | |
def url(page) |
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
MyApp::Application.routes.draw do | |
if Rails.env.production? | |
constraints(:host => /^(?!www\.my-domain\.com)/) do | |
match "(*path)" => redirect { |params, request| URI.parse(request.url).tap { |x| x.host = "www.my-domain.com" }.to_s} | |
end | |
end | |
end |
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
module ActionController | |
class Metal | |
attr_internal :cached_content_for | |
end | |
module Caching | |
module Actions | |
def _save_fragment(name, options) | |
return unless caching_allowed? |