Sha256: 87681706fca6f779b12e555003aab7519f491df26ece0aa7fb8e6b963c88a9e4

Contents?: true

Size: 743 Bytes

Versions: 105

Compression:

Stored size: 743 Bytes

Contents

class ActionController::Base
  def rescues_path_with_facebooker(template_name)
    t = "#{RAILS_ROOT}/vendor/plugins/facebooker/templates/#{template_name}.erb"
    if pretty_facebook_errors? && File.exist?(t)
      t
    else
      rescues_path_without_facebooker(template_name)
    end
  end
  alias_method_chain :rescues_path, :facebooker

  def response_code_for_rescue_with_facebooker(exception)
    pretty_facebook_errors? ? 200 : response_code_for_rescue_without_facebooker(exception)
  end
  alias_method_chain :response_code_for_rescue, :facebooker
  
  
  def pretty_facebook_errors?
    Facebooker.facebooker_config['pretty_errors'] ||
      (Facebooker.facebooker_config['pretty_errors'].nil? && RAILS_ENV=="development")
  end
end

Version data entries

105 entries across 105 versions & 24 rubygems

Version Path
simianarmy-facebooker-1.0.40 lib/facebooker/rails/facebook_pretty_errors.rb
simianarmy-facebooker-1.0.50 lib/facebooker/rails/facebook_pretty_errors.rb
simianarmy-facebooker-1.0.51 lib/facebooker/rails/facebook_pretty_errors.rb
taweili-facebooker-1.0.37 lib/facebooker/rails/facebook_pretty_errors.rb
taweili-facebooker-1.0.38 lib/facebooker/rails/facebook_pretty_errors.rb
taweili-facebooker-1.0.40 lib/facebooker/rails/facebook_pretty_errors.rb
taweili-facebooker-1.0.41 lib/facebooker/rails/facebook_pretty_errors.rb
taweili-facebooker-1.0.45 lib/facebooker/rails/facebook_pretty_errors.rb
taweili-facebooker-1.0.47 lib/facebooker/rails/facebook_pretty_errors.rb
taweili-facebooker-1.0.50 lib/facebooker/rails/facebook_pretty_errors.rb
tenderlove-facebooker-1.0.16.20090319151701 lib/facebooker/rails/facebook_pretty_errors.rb
tenderlove-facebooker-1.0.16.20090319171318 lib/facebooker/rails/facebook_pretty_errors.rb
zerobearing2-facebooker-1.0.46 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.75 lib/facebooker/rails/facebook_pretty_errors.rb
sentientmonkey-facebooker-1.0.74 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-micah-1.0.74 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.74 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.73 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.72 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.71 lib/facebooker/rails/facebook_pretty_errors.rb