Sha256: 3511c7ef9fad4a160725f4b7731a3c8d20dc2ae1f460963656f7054a04f57d9a

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

# RailsyBackbone
Backbone 1.0.0  
Underscore 1.5.1

## Features

### Nested Model Attributes
Allows you to specify a namespace for model attributes by defining a  ```paramRoot```  attribute. For example, 

```javascript
var Book = Backbone.Model.extend({ 
  url: '/books',
  paramRoot: 'book'
});

var book_instance = new Book({ 
  title:  'the illiad', 
  author: 'homer'
});

book_instance.sync();
```

This will cause the HTTP POST to look like this, 

```sh
Started POST "/books" for 127.0.0.1 at 2013-08-03 18:08:56 -0600
  Processing by BooksController#create as JSON
  Parameters: { "book" => { "title" => "the illiad", "author" => "homer" }}
```

### Works with Rails CSRF
Sets the  ```xhr.setRequestHeader```  to the Rails CSRF token in the header.

<br>

## Installation

Add this line to your application's Gemfile:

    gem 'railsy_backbone', github: 'westonplatter/railsy_backbone'

And then execute:

    $ bundle

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
railsy_backbone-0.0.1 README.md