diff --git a/docs/change-log.md b/docs/change-log.md
index da562a81..bdbd2866 100644
--- a/docs/change-log.md
+++ b/docs/change-log.md
@@ -5,6 +5,8 @@
### News:
- The signature of `m` now accepts virtual elements as the second parameter of the function.
+- `m.route(path, params)` now accepts an argument that gets parsed as a querystring.
+- routes now ignore trailing slashes [#88](https://github.com/lhorie/mithril.js/issues/88)
### Bug Fixes:
diff --git a/docs/layout/api.html b/docs/layout/api.html
index 5be15b26..c74da60e 100644
--- a/docs/layout/api.html
+++ b/docs/layout/api.html
@@ -37,7 +37,7 @@
m.route
- m.route(rootElement, defaultRoute, routes)
- - m.route(path)
+ - m.route(path, params)
- m.route()
- m.route(element)
- m.route.mode
diff --git a/docs/mithril.route.md b/docs/mithril.route.md
index 2409cce1..bd70dc0e 100644
--- a/docs/mithril.route.md
+++ b/docs/mithril.route.md
@@ -264,13 +264,17 @@ redirects to `http://server/#/dashboard/marysue`
[How to read signatures](how-to-read-signatures.md)
```clike
-void route(String path)
+void route(String path [, any params])
```
- **String path**
The route to redirect to. Note that to redirect to a different page outside of the scope of Mithril's routing, you should use `window.location`
+- **any params**
+
+ Parameters to pass as a querystring
+
---
diff --git a/mithril.d.ts b/mithril.d.ts
index 958c22c0..7b2c4cef 100644
--- a/mithril.d.ts
+++ b/mithril.d.ts
@@ -6,13 +6,13 @@ interface MithrilStatic {
prop(value?: any): (value?: any) => any;
withAttr(property: string, callback: (value: any) => void): (e: Event) => any;
module(rootElement: Element, module: MithrilModule): void;
- trust(html: string): String
- render(rootElement: Element, children?: any): void
- render(rootElement: HTMLDocument, children?: any): void
- redraw(): void
- route(rootElement: Element, defaultRoute: string, routes: { [key: string]: MithrilModule }): void
- route(rootElement: HTMLDocument, defaultRoute: string, routes: { [key: string]: MithrilModule }): void
- route(path: string): void
+ trust(html: string): String;
+ render(rootElement: Element, children?: any): void;
+ render(rootElement: HTMLDocument, children?: any): void;
+ redraw(): void;
+ route(rootElement: Element, defaultRoute: string, routes: { [key: string]: MithrilModule }): void;
+ route(rootElement: HTMLDocument, defaultRoute: string, routes: { [key: string]: MithrilModule }): void;
+ route(path: string, params?: any, shouldReplaceHistory?: boolean): void;
route(): string;
route(element: Element, isInitialized: boolean): void;
request(options: MithrilXHROptions): MithrilPromise;
diff --git a/mithril.js b/mithril.js
index 0b7360c7..484a514f 100644
--- a/mithril.js
+++ b/mithril.js
@@ -298,9 +298,10 @@ Mithril = m = new function app(window) {
}
else if (typeof arguments[0] == "string") {
currentRoute = arguments[0]
- var shouldReplaceHistoryEntry = arguments[1] === true
- var queryString = typeof arguments[1] == "object" ? buildQueryString(arguments[1]) : null
- if(queryString) currentRoute += (currentRoute.indexOf('?') === -1 ? '?' : '&') + queryString
+ var querystring = typeof arguments[1] == "object" ? buildQueryString(arguments[1]) : null
+ if (querystring) currentRoute += (currentRoute.indexOf("?") === -1 ? "?" : "&") + querystring
+
+ var shouldReplaceHistoryEntry = (arguments.length == 3 ? arguments[2] : arguments[1]) === true
if (window.history.pushState) {
computePostRedrawHook = function() {