Class: FacebookApp::AdminController

Inherits:
FacebookAppController show all
Defined in:
app/controllers/facebook_app/admin_controller.rb

Instance Method Summary collapse

Instance Method Details

#clear_conversion_dataObject



22
23
24
25
# File 'app/controllers/facebook_app/admin_controller.rb', line 22

def clear_conversion_data
  FacebookApp::Conversion.destroy_all
  redirect_to facebook_app.admin_path
end

#create_fb_credentialsObject



35
36
37
38
39
40
41
42
# File 'app/controllers/facebook_app/admin_controller.rb', line 35

def create_fb_credentials
  @fb = FacebookApp::FacebookCredentials.new(params[:facebook_app_facebook_credentials])
  if @fb.save
    redirect_to facebook_app.admin_path, :notice => "Successful updated facebok credentials"
  else
    render :new_fb_credentials
  end
end

#new_fb_credentialsObject



13
14
15
# File 'app/controllers/facebook_app/admin_controller.rb', line 13

def new_fb_credentials 
  @fb = FacebookApp::FacebookCredentials.current_credentials
end

#register_app_access_tokenObject



17
18
19
20
# File 'app/controllers/facebook_app/admin_controller.rb', line 17

def register_app_access_token 
  FacebookApp::FacebookCredentials.register_app_access_token
  render :js => "alert('App access token successfully registered as #{FacebookApp::FacebookCredentials.app_access_token}');".html_safe
end

#showObject



8
9
10
11
# File 'app/controllers/facebook_app/admin_controller.rb', line 8

def show
  @conversion_summary = FacebookApp::ConversionSummary.new
  @fb = FacebookApp::FacebookCredentials.current_credentials
end

#uninstall_appObject



27
28
29
30
31
32
33
# File 'app/controllers/facebook_app/admin_controller.rb', line 27

def uninstall_app
  session[:at] = nil
  session[:uid] = nil
  cookies.clear
  flash[:notice] = "You logged out as a Facebook user"
  redirect_to :back 
end