summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-09-29 10:08:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-09-29 10:08:30 +0000
commit886284b33f1a670be32ff5fd2f93e76089c4d813 (patch)
tree8aedaabb0fc042b41137516ec9a75936b54f34c9 /app/controllers
parent4a36e09d4947425b41dd4d72f6a1a13146922878 (diff)
downloadredmine-886284b33f1a670be32ff5fd2f93e76089c4d813.tar.gz
redmine-886284b33f1a670be32ff5fd2f93e76089c4d813.zip
REST API: custom fields definition (#11159).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12165 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/custom_fields_controller.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rb
index c20516a1d..95d0d507f 100644
--- a/app/controllers/custom_fields_controller.rb
+++ b/app/controllers/custom_fields_controller.rb
@@ -21,10 +21,18 @@ class CustomFieldsController < ApplicationController
before_filter :require_admin
before_filter :build_new_custom_field, :only => [:new, :create]
before_filter :find_custom_field, :only => [:edit, :update, :destroy]
+ accept_api_auth :index
def index
- @custom_fields_by_type = CustomField.all.group_by {|f| f.class.name }
- @tab = params[:tab] || 'IssueCustomField'
+ respond_to do |format|
+ format.html {
+ @custom_fields_by_type = CustomField.all.group_by {|f| f.class.name }
+ @tab = params[:tab] || 'IssueCustomField'
+ }
+ format.api {
+ @custom_fields = CustomField.all
+ }
+ end
end
def new