Skip to content

Commit bad0e82

Browse files
sean0x42bogdan
authored andcommitted
Some minor spelling and grammar improvements in README.md. (#240)
1 parent c380f63 commit bad0e82

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

Readme.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ gem "js-routes"
1414

1515
### Basic Setup
1616

17-
Require js routes file in `application.js` or other bundle
17+
Require JsRoutes in `application.js` or other bundle
1818

1919
``` js
2020
//= require js-routes
@@ -30,17 +30,17 @@ This cache is not flushed on server restart in development environment.
3030

3131
**Important:** If routes.js file is not updated after some configuration change you need to run this rake task again.
3232

33-
### Advanced Setup
33+
### Configuration
3434

35-
If you need to customize routes file create initializer, like `config/initializers/jsroutes.rb`:
35+
You can configure JsRoutes in two main ways. Either with an initializer (e.g. `config/initializers/jsroutes.rb`):
3636

3737
``` ruby
3838
JsRoutes.setup do |config|
3939
config.option = value
4040
end
4141
```
4242

43-
Or make a more dynamic configuration in JavaScript, but only specific options support the possibility of such configuration(see the list below):
43+
Or dynamically in JavaScript, although not all configuration options are supported:
4444

4545
``` js
4646
Routes.configure({
@@ -55,10 +55,10 @@ Available options:
5555
* Option is configurable at JS level with `Routes.configure()`
5656
* Example: {:format => "json", :trailing\_slash => true, :protocol => "https", :subdomain => "api", :host => "example.com", :port => 3000}
5757
* Default: {}
58-
* `exclude` - Array of regexps to exclude from js routes.
58+
* `exclude` - Array of regexps to exclude from routes.
5959
* Default: []
6060
* The regexp applies only to the name before the `_path` suffix, eg: you want to match exactly `settings_path`, the regexp should be `/^settings$/`
61-
* `include` - Array of regexps to include in js routes.
61+
* `include` - Array of regexps to include in routes.
6262
* Default: []
6363
* The regexp applies only to the name before the `_path` suffix, eg: you want to match exactly `settings_path`, the regexp should be `/^settings$/`
6464
* `namespace` - global object used to access routes.
@@ -83,7 +83,7 @@ Available options:
8383
* Example: `jQuery.param` - use jQuery's serializer algorithm. You can attach serialize function from your favorite AJAX framework.
8484
* Example: `MyApp.custom_serialize` - use completely custom serializer of your application.
8585

86-
* `special_options_key` - a special key that helps js-routes to destinguish serialized model from options hash
86+
* `special_options_key` - a special key that helps JsRoutes to destinguish serialized model from options hash
8787
* This option is required because JS doesn't provide a difference between an object and a hash
8888
* Option is configurable at JS level with `Routes.configure()`
8989
* Default: `_options`
@@ -189,25 +189,24 @@ Routes.user_path.required_params // => ['id']
189189
```
190190

191191

192-
## Rails Compatibilities
192+
## Rails Compatibility
193193

194-
JsRoutes ties to be as close as possible to rails behaviour in all aspects of routing API.
195-
Please make and issue in case of any incomtibilities found outside of described below.
194+
JsRoutes tries to replicate the Rails routing API as closely as possible. If you find any incompatibilities (outside of what is described below), please [open an issue](https://github.com/railsware/js-routes/issues/new).
196195

197196
### Object and Hash distinction issue
198197

199-
Sometimes the destinction between JS Hash and Object can not be found by js-routes.
198+
Sometimes the destinction between JS Hash and Object can not be found by JsRoutes.
200199
In this case you would need to pass a special key to help:
201200

202201
``` js
203-
Routes.company_project_path({company_id: 1, id: 2}) // => Not Enough parameters
202+
Routes.company_project_path({company_id: 1, id: 2}) // => Not enough parameters
204203
Routes.company_project_path({company_id: 1, id: 2, _options: true}) // => "/companies/1/projects/2"
205204
```
206205

207206

208207
## What about security?
209208

210-
js-routes itself do not have security holes. It makes URLs
209+
JsRoutes itself do not have security holes. It makes URLs
211210
without access protection more reachable by potential attacker.
212211
In order to prevent this use `:exclude` option for sensitive urls like `/admin_/`
213212

@@ -219,9 +218,9 @@ When using Spork and `Spork.trap_method(Rails::Application::RoutesReloader, :rel
219218
Spork.trap_method(JsRoutes, :generate!)
220219
```
221220

222-
## JS-Routes and heroku
221+
## JsRoutes and Heroku
223222

224-
Heroku environment has a specific problems with setup. It is impossible to use asset pipeline in this environment. You should use "Very Advanced Setup" schema in this case.
223+
When using this setup on Heroku, it is impossible to use the asset pipeline. You should use the "Very Advanced Setup" schema in this case.
225224

226225
For example create routes.js.erb in assets folder with needed content:
227226

@@ -242,10 +241,10 @@ Advantages of this one are:
242241
* Support Rails `#to_param` convention for seo optimized paths
243242
* Well tested
244243

245-
#### Thanks to [Contributors](https://github.com/railsware/js-routes/contributors)
244+
#### Thanks to [contributors](https://github.com/railsware/js-routes/contributors)
246245

247246
#### Have fun
248247

249248

250249
## License
251-
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frailsware%2Fjs-routes.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frailsware%2Fjs-routes?ref=badge_large)
250+
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frailsware%2Fjs-routes.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frailsware%2Fjs-routes?ref=badge_large)

0 commit comments

Comments
 (0)