Module: Facebooker::Rails::Controller

Includes:
ProfilePublisherExtensions
Defined in:
lib/facebooker/rails/controller.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ProfilePublisherExtensions

#render_publisher_error, #render_publisher_interface, #render_publisher_response, #wants_interface?

Class Method Details

.included(controller) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/facebooker/rails/controller.rb', line 7

def self.included(controller)
  controller.extend(ClassMethods)
  controller.before_filter :set_adapter
  controller.before_filter :set_fbml_format
  controller.helper_attr :facebook_session_parameters
  controller.helper_method :request_comes_from_facebook?
end

Instance Method Details

#facebook_paramsObject



34
35
36
# File 'lib/facebooker/rails/controller.rb', line 34

def facebook_params
  @facebook_params ||= verified_facebook_params
end

#facebook_sessionObject



16
17
18
# File 'lib/facebooker/rails/controller.rb', line 16

def facebook_session
  @facebook_session
end

#facebook_session_parametersObject



20
21
22
# File 'lib/facebooker/rails/controller.rb', line 20

def facebook_session_parameters
  {:fb_sig_session_key=>params[:fb_sig_session_key]}
end

#redirect_to(*args) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/facebooker/rails/controller.rb', line 38

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

#set_facebook_sessionObject



25
26
27
28
29
30
31
32
# File 'lib/facebooker/rails/controller.rb', line 25

def set_facebook_session
  returning session_set = session_already_secured? ||  secure_with_facebook_params! || secure_with_cookies! || secure_with_token!  do
    if session_set
      capture_facebook_friends_if_available! 
      Session.current = facebook_session
    end
  end
end