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
facebooker-1.0.70 lib/facebooker/rails/facebook_pretty_errors.rb
benhutton-facebooker-1.0.69.2 lib/facebooker/rails/facebook_pretty_errors.rb
benhutton-facebooker-1.0.69.1 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-rails3-1.0.64 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.69 lib/facebooker/rails/facebook_pretty_errors.rb
cbaclig-facebooker-1.0.67.3 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.68 lib/facebooker/rails/facebook_pretty_errors.rb
cbaclig-facebooker-1.0.67.2 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-lite-1.0.67.2 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-lite-1.0.67.1 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-lite-1.0.67 lib/facebooker/rails/facebook_pretty_errors.rb
fotonauts-facebooker-1.0.67 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.67 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.66 lib/facebooker/rails/facebook_pretty_errors.rb
jet-facebooker-1.0.64 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.65 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.64 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.63 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-1.0.62 lib/facebooker/rails/facebook_pretty_errors.rb
facebooker-fbg1-1.0.61.1 lib/facebooker/rails/facebook_pretty_errors.rb