Module Facebooker::Rails::Controller
In: lib/facebooker/rails/controller.rb
lib/facebooker/rails/cucumber.rb

Methods

Included Modules

Facebooker::Rails::BackwardsCompatibleParamChecks Facebooker::Rails::ProfilePublisherExtensions

Classes and Modules

Module Facebooker::Rails::Controller::ClassMethods

Public Class methods

[Source]

# File lib/facebooker/rails/controller.rb, line 8
      def self.included(controller)
        controller.extend(ClassMethods)
        controller.before_filter :set_facebook_request_format
        controller.helper_attr :facebook_session_parameters
        controller.helper_method :request_comes_from_facebook?
      end

[Source]

# File lib/facebooker/rails/controller.rb, line 15
      def initialize *args
        @facebook_session       = nil
        @installation_required  = nil
        super
      end

Public Instance methods

[Source]

# File lib/facebooker/rails/controller.rb, line 29
      def create_facebook_session
        secure_with_facebook_params! || secure_with_cookies! || secure_with_token!
      end

this is used to proxy a connection through a rails app so the facebook secret key is not needed iphone apps use this

[Source]

# File lib/facebooker/rails/controller.rb, line 35
      def create_facebook_session_with_secret
        secure_with_session_secret!
      end

[Source]

# File lib/facebooker/rails/controller.rb, line 55
      def facebook_params
        @facebook_params ||= verified_facebook_params
      end

[Source]

# File lib/facebooker/rails/controller.rb, line 21
      def facebook_session
        @facebook_session
      end

[Source]

# File lib/facebooker/rails/controller.rb, line 25
      def facebook_session_parameters
        {:fb_sig_session_key=>params[:fb_sig_session_key]}
      end

Return the mock session

[Source]

# File lib/facebooker/rails/cucumber.rb, line 23
      def new_facebook_session
        Facebooker::MockSession.create
      end

prevent Facebooker from rendering fb:redirect

[Source]

# File lib/facebooker/rails/cucumber.rb, line 18
      def redirect_to(*args)
        super
      end

[Source]

# File lib/facebooker/rails/controller.rb, line 81
      def redirect_to(*args)
        if request_is_for_a_facebook_canvas? and !request_is_facebook_tab?
          render :text => fbml_redirect_tag(*args)
        else
          super
        end
      end

[Source]

# File lib/facebooker/rails/controller.rb, line 39
      def set_facebook_session
        # first, see if we already have a session
        session_set = session_already_secured?
        # if not, see if we can load it from the environment
        unless session_set
          session_set = create_facebook_session
          session[:facebook_session] = @facebook_session if session_set
        end
        if session_set
          capture_facebook_friends_if_available! 
          Session.current = facebook_session
        end
        return session_set
      end

Redirects the top window to the given url if the content is in an iframe, otherwise performs a normal redirect_to call.

[Source]

# File lib/facebooker/rails/controller.rb, line 61
      def top_redirect_to(*args)
        if request_is_facebook_iframe?
          @redirect_url = url_for(*args)
          render :layout => false, :inline => "<html><head>\n<script type=\"text/javascript\">\nwindow.top.location.href = <%= @redirect_url.to_json -%>;\n</script>\n<noscript>\n<meta http-equiv=\"refresh\" content=\"0;url=<%=h @redirect_url %>\" />\n<meta http-equiv=\"window-target\" content=\"_top\" />\n</noscript>\n</head></html>\n"
        else
          redirect_to(*args)
        end
      end

[Validate]