README.md in ts_routes-0.1.0 vs README.md in ts_routes-0.2.0

- old
+ new

@@ -1,11 +1,11 @@ # TsRoutes for Rails [![Build Status](https://travis-ci.org/bitjourney/ts_routes-rails.svg?branch=master)](https://travis-ci.org/bitjourney/ts_routes-rails) This gem generates Rails URL helpers in TypeScript, inspired by [js-routes](https://github.com/railsware/js-routes). -## SYNOPSIS +## Usage In your `lib/tasks/ts_routes.rake`: ```ruby:ts_routes.rake @@ -33,11 +33,18 @@ console.log(Routes.entriesPath({ page: 1, per: 20 })); // => /entries?page=1&per=20 console.log(Routes.entryPath(1)); // => /entries/1 ``` +Generated URL helpers are almost compatible with Rails, but they are more strict: +* You must pass required parameters to the helpers as non-named (i.e. normal) arguments + * i.e. `Routes.entryPath(1)` for `/entries/:id` + * `Routes.entryPath({ id })` is refused +* You must pass optional parameters as the last argument + * i.e. `Routes.entriesPath({ page: 1, per: 2 })` + ## Installation Add this line to your application's Gemfile: ```ruby @@ -49,19 +56,9 @@ $ bundle Or install it yourself as: $ gem install ts_routes - -## Usage - -Generated URL helpers are almost compatible with Rails: - -* You must pass required parameters to the helpers as non-named (i.e. normal) arguments - * i.e. `Routes.entryPath(1)` for `/entries/:id` - * `Routes.entryPath({ id })` is refused -* You must pass optional parameters as the last argument - * i.e. `Routes.entriesPath({ page: 1, per: 2 })` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.