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
corey-facebooker-1.0.28.1 lib/facebooker/rails/facebook_pretty_errors.rb
fs-facebooker-1.0.37 lib/facebooker/rails/facebook_pretty_errors.rb
mborromeo-facebooker-1.0.28 lib/facebooker/rails/facebook_pretty_errors.rb
mborromeo-facebooker-1.0.29 lib/facebooker/rails/facebook_pretty_errors.rb
mborromeo-facebooker-1.0.30 lib/facebooker/rails/facebook_pretty_errors.rb
mborromeo-facebooker-1.0.31 lib/facebooker/rails/facebook_pretty_errors.rb
micahwedemeyer-facebooker-1.0.50 lib/facebooker/rails/facebook_pretty_errors.rb
micahwedemeyer-facebooker-1.0.51 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.19 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.20 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.21 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.22 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.23 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.24 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.25 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.26 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.27 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.28 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.29 lib/facebooker/rails/facebook_pretty_errors.rb
mmangino-facebooker-1.0.30 lib/facebooker/rails/facebook_pretty_errors.rb