Sha256: bb09e061e7663f30aa6b1c2dd182c0a6536119ffdba7f0c09b35d41f48e5c1de

Contents?: true

Size: 760 Bytes

Versions: 6

Compression:

Stored size: 760 Bytes

Contents

# cone

Automatically generated Javascript URL helpers based on your Rails routes.

## Usage

```
user GET    /users/:id(.:format)                     users#show
```
Let's say you have this Rails route. Here's how you would access it in Javascript with cone:

```javascript
cone.userPath({id: 12});
"/users/12"

cone.userPath({id: 12, format: 'json'});
"/users/12.json"

cone.userPath({id: 12, format: 'json', foo: 'bar baz'});
"/users/12.json?foo=bar%20baz"
```

Reload the server whenever your routes change to have the Javascript regenerated.

## Installation

1. Add gem 'cone' to your Gemfile.
2. Run bundle install.
3. Add //= require cone to your Javascript manifest file (usually found at app/assets/javascripts/application.js).
4. Restart your server.

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cone-0.2.0 README.md
cone-0.1.0 README.md
cone-0.0.6 README.md
cone-0.0.5 README.md
cone-0.0.4 README.md
cone-0.0.3 README.md