Class: ApiController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/api_controller.rb

Instance Method Summary collapse

Instance Method Details

#activity_atom_feedObject



26
27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/api_controller.rb', line 26

def activity_atom_feed
  @subject = Actor.find_by_slug!(params[:id])
  # FIXME: why? check with Victor
  @subject ||= current_user

  @activities = @subject.wall(:home).page(params[:page]).per(10)
   
  respond_to do |format|
    format.atom
  end
end

#create_keyObject



5
6
7
8
9
10
11
12
# File 'app/controllers/api_controller.rb', line 5

def create_key
  current_user.reset_authentication_token!
  if params[:api_settings].present?
    redirect_to settings_path(:api_settings => true)
    return
  end
  redirect_to :controller => :users, :action => :show, :id => current_user.to_param, :auth_token => params[:auth_token]
end

#usersObject



14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/api_controller.rb', line 14

def users
  if !params[:id]
    params[:id]=current_user.to_param
  end
  
  if !params[:format]
    params[:format]='xml'
  end
      
  redirect_to :controller => :users, :action => :show, :format => params[:format], :id => params[:id], :auth_token => params[:auth_token]
end