Class: ApiController

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

Instance Method Summary collapse

Instance Method Details

#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