Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Docs and Bench : Update all references of Chaplin.helpers to Chaplin.…
Browse files Browse the repository at this point in the history
…utils
  • Loading branch information
Akaryatrh committed Feb 24, 2014
1 parent 45524fa commit d1a9e9b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion docs/_includes/modules.md
Expand Up @@ -28,7 +28,6 @@
* <a href="./chaplin.router.html" title="Replacement for `Backbone.Router`">Chaplin.Router</a>
* <a href="./chaplin.support.html" title="Detection of browser features">Chaplin.support</a>
* <a href="./chaplin.utils.html" title="Generic utility functions">Chaplin.utils</a>
* <a href="./chaplin.helpers.html" title="Helpers with Chaplin integration">Chaplin.helpers</a>

### More
* [Best practices and cookbook](https://github.com/chaplinjs/chaplin/wiki/)
Expand Down
2 changes: 1 addition & 1 deletion docs/chaplin.controller.md
Expand Up @@ -14,7 +14,7 @@ Adjusts document title to `subtitle - title`. A title template can be set when i

<h3 class="module-member" id="redirectTo">redirectTo(params, options)</h3>

Simple proxy to `Chaplin.helpers.redirectTo` that also does `this.redirected = true;`. See [`Chaplin.helpers.redirectTo`](./chaplin.helpers.html#redirectTo) for details.
Simple proxy to `Chaplin.utils.redirectTo` that also does `this.redirected = true;`. See [`Chaplin.utils.redirectTo`](./chaplin.utils.html#redirectTo) for details.

<h3 class="module-member" id="dispose">dispose()</h3>

Expand Down
20 changes: 10 additions & 10 deletions docs/chaplin.router.md
Expand Up @@ -82,16 +82,16 @@ The following properties of the `options` hash are recognized:
For every constraint in the constraints object, there must be a corresponding named placeholder, and it must satisfy the constraint in order for the route to match.
For example, if you have a constraints object with three constraints: x, y, and z, then the route will match if and only if it has named parameters :x, :y, and :z and they all satisfy their respective regex.

* **name** (String): Named routes can be used when reverse-generating paths using `Chaplin.helpers.reverse` helper:
* **name** (String): Named routes can be used when reverse-generating paths using `Chaplin.utils.reverse` helper:

```coffeescript
match 'likes/:id', 'likes#show', name: 'like'
Chaplin.helpers.reverse 'like', id: 581 # => likes/581
Chaplin.utils.reverse 'like', id: 581 # => likes/581
```

```javascript
match('likes/:id', 'likes#show', name: 'like'});
Chaplin.helpers.reverse('like', {id: 581}); // => likes/581
Chaplin.utils.reverse('like', {id: 581}); // => likes/581
```
If no name is provided, the entry will automatically be named by the scheme `controller#action`, e.g. `likes#show`.

Expand All @@ -105,17 +105,17 @@ Route a given path manually. Returns a boolean after it has been matched against
* **name**: name of a [named route](#match), can replace **controller** and **action**,
* **params**: params hash.

For routing from other modules, `Chaplin.helpers.redirectTo` can be used. All of the following would be valid use cases.
For routing from other modules, `Chaplin.utils.redirectTo` can be used. All of the following would be valid use cases.

```coffeescript
Chaplin.helpers.redirectTo 'messages#show', id: 80
Chaplin.helpers.redirectTo controller: 'messages', action: 'show', params: {id: 80}
Chaplin.helpers.redirectTo url: '/messages/80'
Chaplin.utils.redirectTo 'messages#show', id: 80
Chaplin.utils.redirectTo controller: 'messages', action: 'show', params: {id: 80}
Chaplin.utils.redirectTo url: '/messages/80'
```
```javascript
Chaplin.helpers.redirectTo('messages#show', {id: 80});
Chaplin.helpers.redirectTo({controller: 'messages', action: 'show', params: {id: 80}});
Chaplin.helpers.redirectTo({url: '/messages/80'});
Chaplin.utils.redirectTo('messages#show', {id: 80});
Chaplin.utils.redirectTo({controller: 'messages', action: 'show', params: {id: 80}});
Chaplin.utils.redirectTo({url: '/messages/80'});
```

<h3 class="module-member" id="changeURL">changeURL([url])</h3>
Expand Down
6 changes: 3 additions & 3 deletions test/bench.html
Expand Up @@ -123,15 +123,15 @@

var routerBench = suiteBench({
object: function() {
Chaplin.helpers.reverse('null#a', {four: 1});
Chaplin.utils.reverse('null#a', {four: 1});
},
list: function() {
Chaplin.helpers.reverse('null#a', [1]);
Chaplin.utils.reverse('null#a', [1]);
}
});

collectionBench();
// routerBench.run({async: true});
routerBench.run({async: true});
});
</script>
</head>
Expand Down

0 comments on commit d1a9e9b

Please sign in to comment.