Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
1602 committed Jan 29, 2012
1 parent c17b95d commit e0a2854
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -6,20 +6,26 @@ Siple pagination plugin for RailwayJS MVC framework.

1. turn on: **npmfile.js**

```javascript
require('railway-pagination');
```

2. controller: **posts_controller.js**

```javascript
action(function index() {
var page = req.param('page') || 1;
Post.paginate({limit: 10, page: page}, function (err, posts) {
if (err) render({posts: posts});
});
});
```

3. view: **app/views/posts/index.ejs**

```javascript
paginate(posts);
```

## License

Expand Down

0 comments on commit e0a2854

Please sign in to comment.