Sha256: 0416f6d5b2f723463721e4d18b9bf156e9dfff943744ca3706a2b9fc9c04e0d9

Contents?: true

Size: 758 Bytes

Versions: 1

Compression:

Stored size: 758 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.userUrl({id: 12 });
"/users/12"

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

cone.userUrl({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

1 entries across 1 versions & 1 rubygems

Version Path
cone-0.0.2 README.md