Patch #4596 » rest_account.diff
| app/controllers/my_controller.rb | ||
|---|---|---|
|
class MyController < ApplicationController
|
||
|
before_filter :require_login
|
||
|
accept_key_auth :index
|
||
|
helper :issues
|
||
|
helper :custom_fields
|
||
| ... | ... | |
|
def index
|
||
|
page
|
||
|
render :action => 'page'
|
||
|
respond_to do |format|
|
||
|
format.html { render :action => 'page' }
|
||
|
format.xml { render :xml => @user.to_xml }
|
||
|
format.json { render :json => @user.to_json }
|
||
|
end
|
||
|
end
|
||
|
# Show user's page
|
||
| config/routes.rb | ||
|---|---|---|
|
map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog'
|
||
|
map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog'
|
||
|
map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog'
|
||
|
map.with_options :controller => 'my' do |my_routes|
|
||
|
my_routes.with_options :conditions => {:method => :get} do |my_views|
|
||
|
my_views.connect 'my/account.:format', :action => 'index'
|
||
|
end
|
||
|
end
|
||
|
|
||
|
map.with_options :controller => 'timelog' do |timelog|
|
||
|
timelog.connect 'projects/:project_id/time_entries', :action => 'details'
|
||