Sha256: d18537ac786e408fcd90d76963f1d3d7a8dcac94cb83f332cbb0055dc0637dd7
Contents?: true
Size: 1.26 KB
Versions: 26
Compression:
Stored size: 1.26 KB
Contents
class ApplicationController < ActionController::Base protect_from_forgery helper :all before_filter :translate_entity_keys layout Proc.new { |controller| controller.request.xhr? ? nil : 'application' } caches_page :load, :client_notify def load end # this should not make it to the server, but if it does, don't throw an error. # this makes Jonas happy. def client_notify render :text => 'say yah to da up, eh?' end # http://www.treyconnell.com/automatically-raise-recordnotfound-exceptions-rails/ # any time we get a RecordNotFound Exception we're going to rescue from it and throw a 404 # rescue_from ActiveRecord::RecordNotFound, :with => :not_found # Used to take the user to a 404 page # def throw_404 # @browser_title = "Page Not Found" # render_optional_error_file("404") # true # end protected # TSN's entity keys contain periods which confuse Rails' page caching system. These are converted # on the client to underscores and translated here, back into periods, so that they match the # TSN IDs. For example, l_nfl_com-t_9 is converted back to l.nfl.com-t.9. def translate_entity_keys params[:key].gsub!(/_/, ".") if params[:key] end end
Version data entries
26 entries across 26 versions & 1 rubygems