Sha256: 3ef7eb7a78cdc3c2689fe31d36ccfcd159759b84d54ebedc8e48d8cc097abb4e

Contents?: true

Size: 956 Bytes

Versions: 4

Compression:

Stored size: 956 Bytes

Contents

class ApiController < ApplicationController
  
  before_filter :authenticate_user!, :only => [:create_key, :users]#, :activity_atom_feed]
  
  def create_key
    current_user.reset_authentication_token!
    redirect_to :controller => :users, :action => :show, :id => current_user.to_param, :auth_token => params[:auth_token]
  end
  
  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
  
  def activity_atom_feed
    @user = current_user
    if params[:id] != nil
      @user = User.find_by_slug!(params[:id])
    end
    
    @page = params[:page]
    @activities = @user.wall(:home).paginate(:page => params[:page], :per_page => 10)
     
    respond_to do |format|
      format.atom
    end
  end
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
social_stream-base-0.5.1 app/controllers/api_controller.rb
social_stream-base-0.5.0 app/controllers/api_controller.rb
social_stream-0.4.6 app/controllers/api_controller.rb
social_stream-0.4.5 app/controllers/api_controller.rb