From 224921460a0a3d9c97813e4a64f0903adffff22f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 4 Dec 2010 17:43:39 +0000 Subject: Adds a pseudo format to api template names and overrides ActionController#default_template so that api templates are chosen automatically. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4466 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/timelog_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'app/controllers/timelog_controller.rb') diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index 78d31490d..300b28f11 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -76,8 +76,6 @@ class TimelogController < ApplicationController :order => sort_clause, :limit => @entry_pages.items_per_page, :offset => @entry_pages.current.offset) - - render :template => 'timelog/index.apit' } format.atom { entries = TimeEntry.find(:all, @@ -103,7 +101,7 @@ class TimelogController < ApplicationController respond_to do |format| # TODO: Implement html response format.html { render :nothing => true, :status => 406 } - format.api { render :template => 'timelog/show.apit' } + format.api end end @@ -128,7 +126,7 @@ class TimelogController < ApplicationController flash[:notice] = l(:notice_successful_update) redirect_back_or_default :action => 'index', :project_id => @time_entry.project } - format.api { render :template => 'timelog/show.apit', :status => :created, :location => time_entry_url(@time_entry) } + format.api { render :action => 'show', :status => :created, :location => time_entry_url(@time_entry) } end else respond_to do |format| -- cgit v1.2.3