Project

General

Profile

Actions

Patch #1901

closed

RESTful URLs for everything

Added by Gerrit Kaiser over 15 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
2008-09-15
Due date:
% Done:

100%

Estimated time:

Description

I did some work on making Redmine’s URLs adhere to Rails’s RESTful conventions. This is necessary if redmine wants to be ActiveResource-compatible. Imho its worthwhile anyway, as redmine’s current URLs aren’t particularly readable.

Attached is a patch against current SVN. It tries hard not to touch any views and is only minimally invasive in the controllers themselves and non-related tests.

If this generates enough interest, I would go on and modify the forms to iron out the last kinks (use DELETE and PUT HTTP methods where appropriate). Then it would be possible to gradually move the app to use named routes like new_issue_path or project_issues_path('ecookbook') instead of the params hash that is used anywhere. This would de-couple the views and unrelated tests from the URL scheme, allowing further changes. Apart from that it should prove much more readable.

I would propose refactoring the controllers to follow the rails convention of #create, #update etc. as a followup, but that is not even necessary in order to have a full ActiveResource-compliant API.

I made every effort to retain backwards compatibility, left all the old routes intact as a fallback. So incoming links should still work. As the old routing was completely untested, I can’t vouch for that though.


Files

restful_urls_start.diff (74.1 KB) restful_urls_start.diff Gerrit Kaiser, 2008-09-15 03:23

Related issues

Related to Redmine - Feature #296: REST APIClosedJean-Philippe Lang

Actions
Related to Redmine - Feature #2275: provide a nice url for each project, with configurable redirectClosed2008-12-04

Actions
Related to Redmine - Feature #4119: Use /raw/ for url instead of format=raw for showing raw repository filesClosed2009-10-27

Actions
Actions

Also available in: Atom PDF