Sha256: b7856be932ffb01ea30885e703ba559af79ad380faed703e18d616fa1c4f0ac1

Contents?: true

Size: 1.47 KB

Versions: 99

Compression:

Stored size: 1.47 KB

Contents

module ::ActionController
  class Base
    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
    class << self
      alias_method_chain :inherited, :facebooker
    end
  end
end


# When making get requests, Facebook sends fb_sig parameters both in the query string
# and also in the post body. We want to ignore the query string ones because they are one
# request out of date
# We only do thise when there are POST parameters so that IFrame linkage still works
if Rails.version < '2.3'
  class ActionController::AbstractRequest
    def query_parameters_with_facebooker
      if request_parameters.blank?
        query_parameters_without_facebooker
      else
        (query_parameters_without_facebooker||{}).reject {|key,value| key.to_s =~ /^fb_sig/}
      end
    end
  
    alias_method_chain :query_parameters, :facebooker
  end
else
  class ActionController::Request
    def query_parameters_with_facebooker
      if request_parameters.blank?
        query_parameters_without_facebooker
      else
        (query_parameters_without_facebooker||{}).reject {|key,value| key.to_s =~ /^fb_sig/}
      end
    end
  
    alias_method_chain :query_parameters, :facebooker
  end
end

Mime::Type.register_alias "text/html", :fbml
Mime::Type.register_alias "text/javascript", :fbjs

Version data entries

99 entries across 99 versions & 22 rubygems

Version Path
corey-facebooker-1.0.28.1 lib/facebooker/rails/extensions/action_controller.rb
fs-facebooker-1.0.37 lib/facebooker/rails/extensions/action_controller.rb
mborromeo-facebooker-1.0.28 lib/facebooker/rails/extensions/action_controller.rb
mborromeo-facebooker-1.0.29 lib/facebooker/rails/extensions/action_controller.rb
mborromeo-facebooker-1.0.30 lib/facebooker/rails/extensions/action_controller.rb
mborromeo-facebooker-1.0.31 lib/facebooker/rails/extensions/action_controller.rb
micahwedemeyer-facebooker-1.0.50 lib/facebooker/rails/extensions/action_controller.rb
micahwedemeyer-facebooker-1.0.51 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.19 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.20 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.21 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.22 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.23 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.24 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.25 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.26 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.27 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.28 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.29 lib/facebooker/rails/extensions/action_controller.rb
mmangino-facebooker-1.0.30 lib/facebooker/rails/extensions/action_controller.rb