REST API: custom fields definition (#11159).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12165 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-09-29 10:08:30 +00:00
parent 4a36e09d49
commit 886284b33f
5 changed files with 106 additions and 4 deletions
+10 -2
View File
@@ -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