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 -3
View File
@@ -54,7 +54,6 @@ class ProjectsController < ApplicationController
}
format.api {
@projects = Project.visible.find(:all, :order => 'lft')
render :template => 'projects/index.apit'
}
format.atom {
projects = Project.visible.find(:all, :order => 'created_on DESC',
@@ -89,7 +88,7 @@ class ProjectsController < ApplicationController
flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'projects', :action => 'settings', :id => @project
}
format.api { render :template => 'projects/show.apit', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) }
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) }
end
else
respond_to do |format|
@@ -165,7 +164,7 @@ class ProjectsController < ApplicationController
respond_to do |format|
format.html
format.api { render :template => 'projects/show.apit'}
format.api
end
end