diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index f686759..f960951 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -17,7 +17,7 @@ class MyController < ApplicationController before_filter :require_login - + accept_key_auth :index helper :issues helper :custom_fields @@ -39,7 +39,11 @@ class MyController < ApplicationController 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 diff --git a/config/routes.rb b/config/routes.rb index e2560c1..4bca52e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,6 +17,12 @@ ActionController::Routing::Routes.draw do |map| 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'