README.md in rails-routes-js-utils-0.1.4 vs README.md in rails-routes-js-utils-1.0.0
- old
+ new
@@ -1,8 +1,8 @@
# Rails::Routes::Js::Utils
-TODO: Write a gem description
+Make rails route available via window.Routes.*_path() and Array window.AllRoutes
## Installation
Add this line to your application's Gemfile:
@@ -14,12 +14,31 @@
Or install it yourself as:
$ gem install rails-routes-js-utils
+
+Add this to application.js
+
+```
+//= require rails-routes-js-utils
+```
+
## Usage
-TODO: Write usage instructions here
+```javascript
+Routes.blog_post_path(id)
+Routes.blog_posts_path()
+
+for (var i=0; i<AllRoutes.length; i++){
+ if (AllRoutes[i].path.test(pathname)) {
+ console.log(AllRoutes[i]);
+ var controller = AllRoutes[i].reqs.controller;
+ var action = AllRoutes[i].reqs.action;
+}
+```
+
+
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)