Class: ActionController::Base
- Inherits:
-
Object
- Object
- ActionController::Base
- 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
- .inherited_with_facebooker(subclass) ⇒ Object
- .old_relative_url_root ⇒ Object
- .relative_url_root ⇒ Object
Instance Method Summary collapse
- #pretty_facebook_errors? ⇒ Boolean
- #rescues_path_with_facebooker(template_name) ⇒ Object
- #response_code_for_rescue_with_facebooker(exception) ⇒ Object
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_root ⇒ Object
18 |
# File 'lib/facebooker/rails/facebook_url_rewriting.rb', line 18 alias :old_relative_url_root :relative_url_root |
.relative_url_root ⇒ Object
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
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 |