Shopify/batman — Issue #284: Links to show pages must have numbers
Author: dimroc
Created: 2011-12-16 03:59:45+00:00
State: open

Often times one wants to access a REST resource with a friendlier id than an integer. [Friendly_Id](https://github.com/norman/friendly_id) is a gem that does exactly that. When trying to get Batman to access a REST resource using its friendly id over its integral id I get the following GET in my network traffic:

http://localhost:3000/characters/NaN.json
rather than
http://localhost:3000/characters/unique-readable-name.json

Right now I'm switching up my primaryKey to get it to try and use the friendly id when generating the urls from data-route

```html
name will go here
```

```coffee
class Beyonceorrihanna.Character extends Beyonceorrihanna.Model
@storageKey: 'characters'
@primaryKey: 'slug'
@encode 'id', 'name', 'slug', 'caption', 'image_url', 'twitter_tags', 'youtube_id'
@persist Batman.RailsStorage
```

Would be great if this worked. Thanks for all the hard work on Batman!