Permalink
Browse files

Merge branch 'master' of github.com:1602/railway-routes

  • Loading branch information...
2 parents f795aab + 428f18a commit b6a8f142ca2ade0943e60fbbc132467a7f5a82e1 @1602 committed Nov 2, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/railway_routes.js
View
@@ -227,6 +227,8 @@ Map.prototype.resources = function (name, params, actions) {
var self = this;
// params are optional
params = params || {};
+ params.appendFormat = ('appendFormat' in params) ? params.appendFormat : true;
+
// if params arg omitted, second arg may be `actions`
if (typeof params == 'function') {
actions = params;
@@ -262,10 +264,12 @@ Map.prototype.resources = function (name, params, actions) {
var path = route[1];
// append format
- if (path == '/') {
- path = '.:format?';
- } else {
- path += '.:format?';
+ if (params.appendFormat) {
+ if (path == '/') {
+ path = '.:format?';
+ } else {
+ path += '.:format?';
+ }
}
// middleware logic (backward compatibility)

0 comments on commit b6a8f14

Please sign in to comment.