Skip to content

Commit 97019d9

Browse files
committed
Update backbone to 1.2 and underscore to 1.8.3
Signed-off-by: Manu S Ajith <[email protected]>
1 parent d7f0640 commit 97019d9

File tree

3 files changed

+684
-413
lines changed

3 files changed

+684
-413
lines changed

README.md

+23-24
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
# Backbone-Rails [![Build Status](https://secure.travis-ci.org/codebrew/backbone-rails.png)](http://travis-ci.org/codebrew/backbone-rails)[![Gem Version](https://badge.fury.io/rb/rails-backbone.png)](http://badge.fury.io/rb/rails-backbone)
22

3-
Easily setup and use backbone.js (1.1.2) with Rails 3.1 and greater
3+
Easily setup and use backbone.js (1.2.0) with Rails 3.1 and greater
44

55
##Version##
66

77
###Github master branch###
88

9-
Gem version : 1.1.2
9+
Gem version : 1.2.0
1010

11-
Backbone version : 1.1.2
11+
Backbone version : 1.2.0
1212

13-
Underscore version : 1.8.2
13+
Underscore version : 1.8.3
1414

1515
###Rubygems###
1616

17-
Gem version : 0.9.10
17+
Gem version : 1.2.0
1818

19-
Backbone version : 0.9.10
19+
Backbone version : 1.2.0
2020

21-
Underscore version : 1.4.3
21+
Underscore version : 1.8.3
2222

2323

2424
##Credits##
2525
###Author###
2626
[Ryan Fitzgerald](http://twitter.com/#!/TheRyanFitz)
27-
###Current Maintainer
27+
###Current Maintainer
2828
[Manu S Ajith](http://twitter.com/manusajith)
2929
###Contributors###
3030
These [awesome people](https://github.com/codebrew/backbone-rails/graphs/contributors) helped to keep this gem updated
3131

3232
## Rails setup
3333
This gem requires the use of rails 3.1 and greater, coffeescript and the new rails asset pipeline provided by sprockets.
3434

35-
This gem vendors the latest version of underscore.js and backbone.js for Rails 3.1 and greater. The files will be added to the asset pipeline and available for you to use.
36-
35+
This gem vendors the latest version of underscore.js and backbone.js for Rails 3.1 and greater. The files will be added to the asset pipeline and available for you to use.
36+
3737
### Installation
3838

3939
In your Gemfile, add this line:
4040

4141
gem "rails-backbone"
42-
42+
4343
Then run the following commands:
4444

4545
bundle install
@@ -48,34 +48,34 @@ Then run the following commands:
4848
### Layout and namespacing
4949

5050
Running `rails g backbone:install` will create the following directory structure under `app/assets/javascripts/backbone`:
51-
51+
5252
routers/
5353
models/
5454
templates/
5555
views/
56-
56+
5757
It will also create a toplevel app_name.coffee file to setup namespacing and setup initial requires.
58-
58+
5959
## Generators
60-
backbone-rails provides 3 simple generators to help get you started using backbone.js with rails 3.1 and greater.
60+
backbone-rails provides 3 simple generators to help get you started using backbone.js with rails 3.1 and greater.
6161
The generators will only create client side code (javascript).
6262

6363
### Model Generator
6464

6565
rails g backbone:model model_name [property_name:property_type[,]]
66-
66+
6767
This generator creates a backbone model and collection inside `app/assets/javascript/backbone/models` to be used to talk to the rails backend.
6868

6969
### Routers
70-
70+
7171
rails g backbone:router model_name [action_name[,]]
72-
72+
7373
This generator creates a backbone router with corresponding views and templates for the given actions provided.
7474

7575
### Scaffolding
7676

7777
rails g backbone:scaffold model_name [property_name:property_type[,]]
78-
78+
7979
This generator creates a router, views, templates, model and collection to create a simple crud single page app
8080

8181
## Example Usage
@@ -95,8 +95,8 @@ Install the gem and generate scaffolding.
9595
rails g scaffold Post title:string content:string
9696
rake db:migrate
9797
rails g backbone:scaffold Post title:string content:string
98-
99-
You now have installed the backbone-rails gem, setup a default directory structure for your frontend backbone code.
98+
99+
You now have installed the backbone-rails gem, setup a default directory structure for your frontend backbone code.
100100
Then you generated the usual rails server side crud scaffolding and finally generated backbone.js code to provide a simple single page crud app.
101101
You have one last step:
102102

@@ -111,11 +111,11 @@ Edit your posts index view `app/views/posts/index.html.erb` with the following c
111111
Backbone.history.start();
112112
});
113113
</script>
114-
114+
115115
If you prefer haml, this is equivalent to inserting the following code into `app/views/posts/index.html.haml`:
116116

117117
#posts
118-
118+
119119
:javascript
120120
$(function() {
121121
// Blog is the app name
@@ -145,4 +145,3 @@ Change it to add `id` attribute as well
145145
`json.extract! @post, :id, :title, :content, :created_at, :updated_at`
146146

147147
Without adjusting the JSON show view, you will be redirected to a "undefined" url after creating an object.
148-

0 commit comments

Comments
 (0)