Class: ActionController::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/facebooker/rails/facebook_pretty_errors.rb,
lib/facebooker/rails/facebook_url_rewriting.rb,
lib/facebooker/rails/extensions/action_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.inherited_with_facebooker(subclass) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/facebooker/rails/extensions/action_controller.rb', line 3

def self.inherited_with_facebooker(subclass)
  inherited_without_facebooker(subclass)
  if subclass.to_s == "ApplicationController"
    subclass.send(:include,Facebooker::Rails::Controller) 
    subclass.helper Facebooker::Rails::Helpers
  end
end

.old_relative_url_rootObject



18
# File 'lib/facebooker/rails/facebook_url_rewriting.rb', line 18

alias :old_relative_url_root :relative_url_root

.relative_url_rootObject



19
20
21
# File 'lib/facebooker/rails/facebook_url_rewriting.rb', line 19

def relative_url_root
  Facebooker.path_prefix
end

Instance Method Details

#pretty_facebook_errors?Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/facebooker/rails/facebook_pretty_errors.rb', line 18

def pretty_facebook_errors?
  Facebooker.facebooker_config['pretty_errors'] ||
    (Facebooker.facebooker_config['pretty_errors'].nil? && RAILS_ENV=="development")
end

#rescues_path_with_facebooker(template_name) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/facebooker/rails/facebook_pretty_errors.rb', line 2

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

#response_code_for_rescue_with_facebooker(exception) ⇒ Object



12
13
14
# File 'lib/facebooker/rails/facebook_pretty_errors.rb', line 12

def response_code_for_rescue_with_facebooker(exception)
  pretty_facebook_errors? ? 200 : response_code_for_rescue_without_facebooker(exception)
end