Merge pull request #1337 from gollum/cleanup_route_naming
Use snake_case uniformly for all routes.
This commit is contained in:
+2
-2
@@ -127,7 +127,7 @@ module Precious
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
get '/last-commit-info' do
|
get '/last_commit_info' do
|
||||||
content_type :json
|
content_type :json
|
||||||
if page = wiki_page(params[:path]).page
|
if page = wiki_page(params[:path]).page
|
||||||
version = page.last_version
|
version = page.last_version
|
||||||
@@ -180,7 +180,7 @@ module Precious
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
post '/uploadFile' do
|
post '/upload_file' do
|
||||||
wiki = wiki_new
|
wiki = wiki_new
|
||||||
|
|
||||||
unless wiki.allow_uploads
|
unless wiki.allow_uploads
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
|
|
||||||
var id = fieldAttributes.id || 'upload';
|
var id = fieldAttributes.id || 'upload';
|
||||||
var name = fieldAttributes.name || 'file';
|
var name = fieldAttributes.name || 'file';
|
||||||
var action = fieldAttributes.action || '/uploadFile';
|
var action = fieldAttributes.action || '/upload_file';
|
||||||
|
|
||||||
html += '<form method=post enctype="multipart/form-data" ' +
|
html += '<form method=post enctype="multipart/form-data" ' +
|
||||||
'action="' + action + '" ' + 'id="' + id + '">';
|
'action="' + action + '" ' + 'id="' + id + '">';
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ module Precious
|
|||||||
module RouteHelpers
|
module RouteHelpers
|
||||||
ROUTES = {
|
ROUTES = {
|
||||||
'gollum' => {
|
'gollum' => {
|
||||||
last_commit_info: 'last-commit-info',
|
last_commit_info: 'last_commit_info',
|
||||||
latest_changes: 'latest_changes',
|
latest_changes: 'latest_changes',
|
||||||
upload_file: 'uploadFile',
|
upload_file: 'upload_file',
|
||||||
create: 'create',
|
create: 'create',
|
||||||
delete: 'delete',
|
delete: 'delete',
|
||||||
edit: 'edit',
|
edit: 'edit',
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ context "Frontend" do
|
|||||||
@wiki.write_page(page1, :markdown, '',
|
@wiki.write_page(page1, :markdown, '',
|
||||||
{ :name => user1, :email => user1 });
|
{ :name => user1, :email => user1 });
|
||||||
|
|
||||||
get "/gollum/last-commit-info", :path => page1
|
get "/gollum/last_commit_info", :path => page1
|
||||||
assert_match /\"author\":\"user1\"/, last_response.body
|
assert_match /\"author\":\"user1\"/, last_response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user