Defect #7819 ยป restadditions.diff
app/controllers/issue_statuses_controller.rb | ||
---|---|---|
26 | 26 |
def index |
27 | 27 |
@issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 25, :order => "position" |
28 | 28 |
render :action => "index", :layout => false if request.xhr? |
29 |
respond_to do |format| |
|
30 |
format.html |
|
31 |
format.api |
|
32 |
end |
|
29 | 33 |
end |
30 | 34 | |
31 | 35 |
def new |
app/controllers/trackers_controller.rb | ||
---|---|---|
25 | 25 |
def index |
26 | 26 |
@tracker_pages, @trackers = paginate :trackers, :per_page => 10, :order => 'position' |
27 | 27 |
render :action => "index", :layout => false if request.xhr? |
28 |
respond_to do |format| |
|
29 |
format.html |
|
30 |
format.api |
|
31 |
end |
|
28 | 32 |
end |
29 | 33 | |
30 | 34 |
def new |
app/views/issue_statuses/index.api.rsb | ||
---|---|---|
1 |
api.array :issue_statuses do |
|
2 |
@issue_statuses.each do |status| |
|
3 |
api.status do |
|
4 |
api.name status.name |
|
5 |
end |
|
6 |
end |
|
7 |
end |
app/views/issues/show.api.rsb | ||
---|---|---|
10 | 10 |
api.fixed_version(:id => @issue.fixed_version_id, :name => @issue.fixed_version.name) unless @issue.fixed_version.nil? |
11 | 11 |
api.parent(:id => @issue.parent_id) unless @issue.parent.nil? |
12 | 12 |
|
13 |
api.array :assignable_users do |
|
14 |
@issue.assignable_users.each do |user| |
|
15 |
api.users do |
|
16 |
api.id user.id |
|
17 |
api.name user.name |
|
18 |
end |
|
19 |
end |
|
20 |
end |
|
21 | ||
22 |
api.array :assignable_versions do |
|
23 |
@issue.assignable_versions.each do |version| |
|
24 |
api.versions do |
|
25 |
api.id version.id |
|
26 |
api.name version.name |
|
27 |
end |
|
28 |
end |
|
29 |
end |
|
30 | ||
31 | ||
13 | 32 |
api.subject @issue.subject |
14 | 33 |
api.description @issue.description |
15 | 34 |
api.start_date @issue.start_date |
app/views/trackers/index.api.rsb | ||
---|---|---|
1 |
api.array :trackers do |
|
2 |
@trackers.each do |tracker| |
|
3 |
api.trackers do |
|
4 |
api.name tracker.name |
|
5 |
end |
|
6 |
end |
|
7 |
end |
config/environment.rb | ||
---|---|---|
52 | 52 | |
53 | 53 |
config.gem 'rubytree', :lib => 'tree' |
54 | 54 |
config.gem 'coderay', :version => '~>0.9.7' |
55 |
|
|
55 |
config.action_controller.session = { :key => "_myapp_session", :secret => "ec8d6656e5d3dd4020615a92127a0aa2" } |
|
56 | 56 |
# Load any local configuration that is kept out of source control |
57 | 57 |
# (e.g. gems, patches). |
58 | 58 |
if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb')) |
config/routes.rb | ||
---|---|---|
90 | 90 |
reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details' |
91 | 91 |
end |
92 | 92 | |
93 |
map.connect '/trackers.:format', :controller => 'trackers', :action => 'index', :conditions => { :method => :get } |
|
94 |
map.connect '/issue_statuses.:format', :controller => 'issue_statuses', :action => 'index', :conditions => { :method => :get } |
|
93 | 95 |
# Following two routes conflict with the resources because #index allows POST |
94 | 96 |
map.connect '/issues', :controller => 'issues', :action => 'index', :conditions => { :method => :post } |
95 | 97 |
map.connect '/issues/create', :controller => 'issues', :action => 'index', :conditions => { :method => :post } |