Sha256: 156bd90dfb16b121bb6100c9f7f0af1fef2d57091cd5ad362ea9266d7642a90c

Contents?: true

Size: 953 Bytes

Versions: 1

Compression:

Stored size: 953 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(:profile).paginate(:page => params[:page], :per_page => 10)
    respond_to do |format|
      format.atom
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
social_stream-0.4.4 app/controllers/api_controller.rb