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
This commit is contained in:
Jean-Philippe Lang
2010-12-04 17:43:39 +00:00
parent 9157482049
commit 224921460a
14 changed files with 32 additions and 15 deletions
+2 -4
View File
@@ -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|